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

added more tests, added random for project_name

parent a5aba69c
No related branches found
No related tags found
No related merge requests found
...@@ -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):
......
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