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
d602a58a
Commit
d602a58a
authored
5 years ago
by
Swen Vermeul
Browse files
Options
Downloads
Patches
Plain Diff
added more tests, added random for project_name
parent
a5aba69c
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_project.py
+8
-2
8 additions, 2 deletions
pybis/src/python/tests/test_project.py
with
8 additions
and
2 deletions
pybis/src/python/tests/test_project.py
+
8
−
2
View file @
d602a58a
...
@@ -18,12 +18,18 @@ def test_create_delete_project(space):
...
@@ -18,12 +18,18 @@ def test_create_delete_project(space):
project
.
save
()
project
.
save
()
assert
"
should not have been created
"
is
None
assert
"
should not have been created
"
is
None
project_name
=
'
project_
'
+
timestamp
project_name
=
'
project_
'
+
timestamp
+
"
_
"
+
str
(
random
.
randint
(
0
,
1000
))
project
=
o
.
new_project
(
space
=
space
,
code
=
project_name
)
project
=
o
.
new_project
(
space
=
space
,
code
=
project_name
)
project
.
save
()
project
.
save
()
project_exists
=
o
.
get_project
(
project_name
)
project_exists
=
o
.
get_project
(
project_name
)
assert
project_exists
is
not
None
assert
project_exists
is
not
None
projects_exist
=
o
.
get_projects
()
assert
len
(
projects_exist
)
>
0
first_project
=
projects_exist
[
0
]
assert
first_project
is
not
None
project_exists
.
delete
(
'
test project on
'
+
timestamp
)
project_exists
.
delete
(
'
test project on
'
+
timestamp
)
with
pytest
.
raises
(
ValueError
):
with
pytest
.
raises
(
ValueError
):
...
@@ -35,7 +41,7 @@ def test_create_project_with_attachment(space):
...
@@ -35,7 +41,7 @@ def test_create_project_with_attachment(space):
o
=
space
.
openbis
o
=
space
.
openbis
timestamp
=
time
.
strftime
(
'
%a_%y%m%d_%H%M%S
'
).
upper
()
timestamp
=
time
.
strftime
(
'
%a_%y%m%d_%H%M%S
'
).
upper
()
project_name
=
'
project_
'
+
timestamp
project_name
=
'
project_
'
+
timestamp
+
"
_
"
+
str
(
random
.
randint
(
0
,
1000
))
filename
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
testfile
'
)
filename
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
testfile
'
)
if
not
os
.
path
.
exists
(
filename
):
if
not
os
.
path
.
exists
(
filename
):
...
...
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