From 61a27978d72fb2b0805448dcdb2444a5f04d96a0 Mon Sep 17 00:00:00 2001 From: vermeul <swen@ethz.ch> Date: Wed, 14 Aug 2019 16:31:25 +0200 Subject: [PATCH] changed connection to localhost:20000, create a new space every time and do not rely on DEFAULT space --- pybis/src/python/tests/conftest.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/pybis/src/python/tests/conftest.py b/pybis/src/python/tests/conftest.py index 21790a31f97..3f705cb916b 100644 --- a/pybis/src/python/tests/conftest.py +++ b/pybis/src/python/tests/conftest.py @@ -3,13 +3,17 @@ import time from pybis import Openbis -openbis_url = 'https://localhost:8443' -admin_username = 'admin' -admin_password = 'changeit' +openbis_url = 'http://localhost:20000' +admin_username = 'openbis_test_js' +admin_password = 'password' @pytest.yield_fixture(scope="module") def openbis_instance(): - instance = Openbis(url=openbis_url, verify_certificates=False) + instance = Openbis( + url=openbis_url, + verify_certificates=False, + allow_http_but_do_not_use_this_in_production_and_only_within_safe_networks=True + ) print("\nLOGGING IN...") instance.login(admin_username, admin_password) yield instance @@ -19,10 +23,20 @@ def openbis_instance(): @pytest.yield_fixture(scope="module") def space(): - o = Openbis(url=openbis_url, verify_certificates=False) + o = Openbis( + url=openbis_url, + verify_certificates=False, + allow_http_but_do_not_use_this_in_production_and_only_within_safe_networks=True + ) o.login(admin_username, admin_password) - space_exists = o.get_space(code='DEFAULT') + # create a space + timestamp = time.strftime('%a_%y%m%d_%H%M%S').upper() + space_name = 'test_space_' + timestamp + space = o.new_space(code=space_name) + space.save() + space_exists = o.get_space(code=space_name) yield space_exists + # teardown o.logout() -- GitLab