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
1efd8e33
Commit
1efd8e33
authored
5 years ago
by
Swen Vermeul
Browse files
Options
Downloads
Patches
Plain Diff
added more vocabulary tests
parent
72a12963
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_vocabulary.py
+25
-6
25 additions, 6 deletions
pybis/src/python/tests/test_vocabulary.py
with
25 additions
and
6 deletions
pybis/src/python/tests/test_vocabulary.py
+
25
−
6
View file @
1efd8e33
...
@@ -8,11 +8,30 @@ import time
...
@@ -8,11 +8,30 @@ import time
def
test_create_delete_vocabulay_terms
(
openbis_instance
):
def
test_create_delete_vocabulay_terms
(
openbis_instance
):
o
=
openbis_instance
o
=
openbis_instance
timestamp
=
time
.
strftime
(
'
%a_%y%m%d_%H%M%S
'
).
upper
()
terms
=
o
.
get_terms
()
voc_code
=
'
test_voc_
'
+
timestamp
+
"
_
"
+
str
(
random
.
randint
(
0
,
1000
))
assert
terms
is
not
None
assert
terms
.
df
is
not
None
voc
=
o
.
new_vocabulary
(
code
=
voc_code
,
description
=
'
description of vocabulary
'
,
urlTemplate
=
'
https://ethz.ch
'
,
terms
=
[
{
"
code
"
:
'
term_code1
'
,
"
label
"
:
"
term_label1
"
,
"
description
"
:
"
term_description1
"
},
{
"
code
"
:
'
term_code2
'
,
"
label
"
:
"
term_label2
"
,
"
description
"
:
"
term_description2
"
},
{
"
code
"
:
'
term_code3
'
,
"
label
"
:
"
term_label3
"
,
"
description
"
:
"
term_description3
"
}
]
)
assert
voc
.
registrationDate
is
None
voc
.
save
()
assert
voc
is
not
None
assert
voc
.
registrationDate
is
not
None
voc_exists
=
o
.
get_vocabulary
(
voc_code
)
assert
voc_exists
is
not
None
assert
voc_exists
.
code
==
voc_code
.
upper
()
voc
.
delete
(
'
test on
'
+
str
(
timestamp
))
with
pytest
.
raises
(
ValueError
):
voc_exists
=
o
.
get_vocabulary
(
voc_code
)
assert
1
==
0
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