Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
989d02a5
Commit
989d02a5
authored
3 years ago
by
Swen Vermeul
Browse files
Options
Downloads
Patches
Plain Diff
fixed test
parent
fe470982
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pybis/src/python/tests/test_openbis.py
+11
-12
11 additions, 12 deletions
pybis/src/python/tests/test_openbis.py
with
11 additions
and
12 deletions
pybis/src/python/tests/test_openbis.py
+
11
−
12
View file @
989d02a5
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment