File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 110.16.12
2+ - tests: allow to use different DCOR instance for testing
23 - tests: make tests independent of testing user
340.16.11
45 - fix: support CKAN 2.11 (authorization and status_show)
Original file line number Diff line number Diff line change 1- api_key
1+ api_key *
Original file line number Diff line number Diff line change 1313from dcoraid .upload import UploadQueue
1414
1515
16- SERVER = "dcor-dev.mpl.mpg.de"
16+ # You can run e.g. tests on a local DCOR instance with
17+ # export DCORAID_TEST_SERVER="http://192.168.122.143"
18+ SERVER = os .environ .get ("DCORAID_TEST_SERVER" , "dcor-dev.mpl.mpg.de" )
19+
1720dpath = pathlib .Path (__file__ ).parent / "data" / "calibration_beads_47.rtdc"
1821
1922
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ def pytest_configure(config):
5252 settings .setIniCodec ("utf-8" )
5353 settings .setValue ("check for updates" , "0" )
5454 settings .setValue ("user scenario" , "dcor-dev" )
55- settings .setValue ("auth/server" , "dcor-dev.mpl.mpg.de" )
55+ settings .setValue ("auth/server" , common . SERVER )
5656 settings .setValue ("auth/api key" , common .get_api_key ())
5757 settings .setValue ("debug/without timers" , "1" )
5858 settings .sync ()
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def test_api_requests_cache_no_parameters():
1313 t0 = time .perf_counter ()
1414 api .get ("status_show" )
1515 t1 = time .perf_counter ()
16- for ii in range (50 ):
16+ for ii in range (20 ):
1717 api .get ("status_show" )
1818 t2 = time .perf_counter ()
1919 assert (t1 - t0 ) > (t2 - t1 )
@@ -25,7 +25,7 @@ def test_api_requests_cache_with_parameters():
2525 t0 = time .perf_counter ()
2626 api .get ("organization_list_for_user" , permission = "create_dataset" )
2727 t1 = time .perf_counter ()
28- for ii in range (50 ):
28+ for ii in range (20 ):
2929 api .get ("organization_list_for_user" , permission = "create_dataset" )
3030 t2 = time .perf_counter ()
3131 assert (t1 - t0 ) > (t2 - t1 )
Original file line number Diff line number Diff line change @@ -38,14 +38,13 @@ def test_get_collections():
3838
3939
4040def test_get_users_anonymous ():
41- api = CKANAPI ( server = "dcor-dev.mpl.mpg.de" )
41+ api = common . get_api ( )
4242 db = db_api .APIInterrogator (api = api )
4343 with pytest .raises (errors .APIAuthorizationError , match = "Access denied" ):
4444 db .get_users ()
4545
4646
4747def test_public_api_interrogator ():
48- """This test uses the figshare datasets on SERVER"""
4948 api = common .get_api ()
5049 db = db_api .APIInterrogator (api = api )
5150 defaults = common .get_test_defaults ()
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ def mw(qtbot):
2727 QtCore .QSettings .setDefaultFormat (QtCore .QSettings .IniFormat )
2828 settings = QtCore .QSettings ()
2929 settings .setIniCodec ("utf-8" )
30- settings .setValue ("auth/server" , "dcor-dev.mpl.mpg.de" )
30+ settings .setValue ("auth/server" , common . SERVER )
3131 QtTest .QTest .qWait (100 )
3232 QtWidgets .QApplication .processEvents (QtCore .QEventLoop .AllEvents , 5000 )
3333 # Code that will run before your test
@@ -165,7 +165,7 @@ def test_gui_start_with_bad_server(qtbot):
165165 raise
166166 finally :
167167 # reset to testing defaults
168- settings .setValue ("auth/server" , "dcor-dev.mpl.mpg.de" )
168+ settings .setValue ("auth/server" , common . SERVER )
169169
170170
171171def test_gui_start_with_bad_api_key (qtbot ):
You can’t perform that action at this time.
0 commit comments