Skip to content

Commit 8556765

Browse files
committed
fixing deploy workflow 6
1 parent 49562e5 commit 8556765

File tree

5 files changed

+19
-29
lines changed

5 files changed

+19
-29
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

orientpy/tests/test_1_args.py

+19-29
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
dbfile = resource_filename('orientpy',
88
'examples/data/LOBS3.pkl')
99

10+
1011
def test_dl_calc_args():
1112
from orientpy.scripts import dl_calc as dl
1213
# no stdb
13-
with pytest.raises(SystemExit) as excinfo:
14-
dl.get_dl_calc_arguments()
15-
assert excinfo.value.code == 1
16-
14+
with pytest.raises(SystemExit):
15+
dl.get_dl_calc_arguments([])
1716
# defaults
1817
args0 = dl.get_dl_calc_arguments([dbfile])
1918
# keys
@@ -22,24 +21,21 @@ def test_dl_calc_args():
2221
# start time
2322
args = dl.get_dl_calc_arguments(
2423
[dbfile, '--start', '2014-10-01'])
25-
with pytest.raises(SystemExit) as excinfo:
24+
with pytest.raises(SystemExit):
2625
dl.get_dl_calc_arguments([
2726
dbfile, '--start', 'abcd'])
28-
assert excinfo.value.code == 1
2927
# end time
3028
args = dl.get_dl_calc_arguments([
3129
dbfile, '--end', '2015-01-01'])
32-
with pytest.raises(SystemExit) as excinfo:
30+
with pytest.raises(SystemExit):
3331
dl.get_dl_calc_arguments([
3432
dbfile, '--end', 'abcd'])
35-
assert excinfo.value.code == 1
3633
# user auth.
3734
args = dl.get_dl_calc_arguments([
3835
dbfile, '-U', 'bla:bla'])
39-
with pytest.raises(SystemExit) as excinfo:
36+
with pytest.raises(SystemExit):
4037
dl.get_dl_calc_arguments([
4138
dbfile, '-U', 'abcd'])
42-
assert excinfo.value.code == 1
4339
# local data
4440
args = dl.get_dl_calc_arguments([
4541
dbfile, '--local-data', 'bla'])
@@ -49,12 +45,12 @@ def test_dl_calc_args():
4945

5046
return args0
5147

48+
5249
def test_dl_average_args():
5350
from orientpy.scripts import dl_average as dl
5451
# no stdb
55-
with pytest.raises(SystemExit) as excinfo:
56-
dl.get_dl_average_arguments()
57-
assert excinfo.value.code == 1
52+
with pytest.raises(SystemExit):
53+
dl.get_dl_average_arguments([])
5854
# defaults
5955
args0 = dl.get_dl_average_arguments([dbfile])
6056
# keys
@@ -66,9 +62,8 @@ def test_dl_average_args():
6662
def test_bng_calc_args():
6763
from orientpy.scripts import bng_calc_auto as bng
6864
# no stdb
69-
with pytest.raises(SystemExit) as excinfo:
70-
bng.get_bng_calc_arguments()
71-
assert excinfo.value.code == 1
65+
with pytest.raises(SystemExit):
66+
bng.get_bng_calc_arguments([])
7267
# default
7368
args0 = bng.get_bng_calc_arguments([dbfile])
7469
# keys
@@ -77,24 +72,21 @@ def test_bng_calc_args():
7772
# start time
7873
args = bng.get_bng_calc_arguments(
7974
[dbfile, '--start', '2014-10-01'])
80-
with pytest.raises(SystemExit) as excinfo:
75+
with pytest.raises(SystemExit):
8176
bng.get_bng_calc_arguments([
8277
dbfile, '--start', 'abcd'])
83-
assert excinfo.value.code == 1
8478
# end time
8579
args = bng.get_bng_calc_arguments([
8680
dbfile, '--end', '2015-01-01'])
87-
with pytest.raises(SystemExit) as excinfo:
81+
with pytest.raises(SystemExit):
8882
bng.get_bng_calc_arguments([
8983
dbfile, '--end', 'abcd'])
90-
assert excinfo.value.code == 1
9184
# user auth.
9285
args = bng.get_bng_calc_arguments([
9386
dbfile, '-U', 'bla:bla'])
94-
with pytest.raises(SystemExit) as excinfo:
87+
with pytest.raises(SystemExit):
9588
bng.get_bng_calc_arguments([
9689
dbfile, '-U', 'abcd'])
97-
assert excinfo.value.code == 1
9890
# local data
9991
args = bng.get_bng_calc_arguments([
10092
dbfile, '--local-data', 'bla'])
@@ -104,26 +96,24 @@ def test_bng_calc_args():
10496
# bp
10597
args = bng.get_bng_calc_arguments([
10698
dbfile, '--bp', '1.,2.'])
107-
with pytest.raises(SystemExit) as excinfo:
99+
with pytest.raises(SystemExit):
108100
bng.get_bng_calc_arguments([
109101
dbfile, '--bp', '1.'])
110-
assert excinfo.value.code == 1
111102
# tt
112103
args = bng.get_bng_calc_arguments([
113104
dbfile, '--times', '1.,2.'])
114-
with pytest.raises(SystemExit) as excinfo:
105+
with pytest.raises(SystemExit):
115106
bng.get_bng_calc_arguments([
116107
dbfile, '--times', '1.'])
117-
assert excinfo.value.code == 1
118108

119109
return args0
120110

111+
121112
def test_bng_average_args():
122113
from orientpy.scripts import bng_average as bng
123114
# no stdb
124-
with pytest.raises(SystemExit) as excinfo:
125-
bng.get_bng_average_arguments()
126-
assert excinfo.value.code == 1
115+
with pytest.raises(SystemExit):
116+
bng.get_bng_average_arguments([])
127117
# defaults
128118
args0 = bng.get_bng_average_arguments([dbfile])
129119
# keys

0 commit comments

Comments
 (0)