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

sample.space no longer returns a code only, but the space object. Changed test accordingly

parent 31ee5160
No related branches found
No related tags found
No related merge requests found
...@@ -20,10 +20,9 @@ def test_create_delete_sample(space): ...@@ -20,10 +20,9 @@ def test_create_delete_sample(space):
sample_code = 'test_sample_'+timestamp sample_code = 'test_sample_'+timestamp
sample = o.new_sample(code=sample_code, type=sample_type, space=space) sample = o.new_sample(code=sample_code, type=sample_type, space=space)
assert sample is not None assert sample is not None
assert sample.space == space assert sample.space.code == space.code
assert sample.code == sample_code assert sample.code == sample_code
assert sample.permId == ''
assert sample.permId is None
sample.save() sample.save()
# now there should appear a permId # now there should appear a permId
...@@ -58,7 +57,7 @@ def test_create_delete_space_sample(space): ...@@ -58,7 +57,7 @@ def test_create_delete_space_sample(space):
sample = space.new_sample(code=sample_code, type=sample_type) sample = space.new_sample(code=sample_code, type=sample_type)
assert sample is not None assert sample is not None
assert sample.space == space assert sample.space.code == space.code
assert sample.code == sample_code assert sample.code == sample_code
sample.save() sample.save()
assert sample.permId is not None assert sample.permId is not None
...@@ -79,11 +78,11 @@ def test_parent_child(space): ...@@ -79,11 +78,11 @@ def test_parent_child(space):
ex_sample_parents = sample_child.get_parents() ex_sample_parents = sample_child.get_parents()
ex_sample_parent = ex_sample_parents[0] ex_sample_parent = ex_sample_parents[0]
assert ex_sample_parent.identifier == '/DEFAULT/{}'.format(parent_code).upper() assert ex_sample_parent.identifier == '/{}/{}'.format(space.code, parent_code).upper()
ex_sample_children = ex_sample_parent.get_children() ex_sample_children = ex_sample_parent.get_children()
ex_sample_child = ex_sample_children[0] ex_sample_child = ex_sample_children[0]
assert ex_sample_child.identifier == '/DEFAULT/{}'.format(child_code).upper() assert ex_sample_child.identifier == '/{}/{}'.format(space.code, child_code).upper()
sample_parent.delete('sample parent-child creation test on '+timestamp) sample_parent.delete('sample parent-child creation test on '+timestamp)
sample_child.delete('sample parent-child creation test on '+timestamp) sample_child.delete('sample parent-child creation test on '+timestamp)
......
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