Newer
Older
#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():
Swen Vermeul
committed
instance = Openbis(
url=openbis_url,
verify_certificates=False,
allow_http_but_do_not_use_this_in_production_and_only_within_safe_networks=True
)
yield instance
instance.logout()
print("LOGGED OUT...")
@pytest.yield_fixture(scope="module")
def space():
Swen Vermeul
committed
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)
Swen Vermeul
committed
# 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)
Swen Vermeul
committed
# teardown