Skip to content
Snippets Groups Projects
Commit 989d02a5 authored by Swen Vermeul's avatar Swen Vermeul
Browse files

fixed test

parent fe470982
No related branches found
No related tags found
No related merge requests found
...@@ -16,29 +16,28 @@ def test_token(openbis_instance): ...@@ -16,29 +16,28 @@ def test_token(openbis_instance):
def test_http_only(openbis_instance): def test_http_only(openbis_instance):
with pytest.raises(Exception): with pytest.raises(Exception):
new_instance = Openbis('http://localhost') new_instance = Openbis("http://localhost")
assert new_instance is None assert new_instance is None
new_instance = Openbis(url='http://localhost', allow_http_but_do_not_use_this_in_production_and_only_within_safe_networks=True) new_instance = Openbis(
url="http://localhost",
allow_http_but_do_not_use_this_in_production_and_only_within_safe_networks=True,
)
assert new_instance is not None assert new_instance is not None
def test_cached_token(openbis_instance): def test_cached_token(other_openbis_instance):
openbis_instance.save_token() assert other_openbis_instance.token_path is not None
assert openbis_instance.token_path is not None assert other_openbis_instance.is_token_valid() is True
assert openbis_instance._get_cached_token() is not None
another_instance = Openbis(openbis_instance.url, verify_certificates=openbis_instance.verify_certificates) other_openbis_instance.logout()
assert another_instance.is_token_valid() is True assert other_openbis_instance.is_token_valid() is False
openbis_instance.delete_token()
assert openbis_instance._get_cached_token() is None
def test_create_permId(openbis_instance): def test_create_permId(openbis_instance):
permId = openbis_instance.create_permId() permId = openbis_instance.create_permId()
assert permId is not None assert permId is not None
m = re.search('([0-9]){17}-([0-9]*)', permId) m = re.search("([0-9]){17}-([0-9]*)", permId)
ts = m.group(0) ts = m.group(0)
assert ts is not None assert ts is not None
count = m.group(1) count = m.group(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment