Commit 67ca46d4 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

server unit tests: Add tests for SampleSets::get_tag_names

We thus need to add tag_ref that didn't exist yet in the test DB
parent 9021013f
Pipeline #44145 passed with stages
in 8 minutes and 13 seconds
......@@ -31,3 +31,11 @@ class SamplesetsModel(unittest.TestCase):
self.assertEquals(names[fake_sample_set_id], "plo")
self.assertEquals(names[permission_sample_set], "bar")
def testGetTagNames(self):
samples = SampleSets([fake_sample_set_id, permission_sample_set])
names = samples.get_tag_names()
self.assertEquals('first_fake_tag' in names[fake_sample_set_id], True)
self.assertEquals('sec_fake_tag' in names[fake_sample_set_id], True)
self.assertEquals(permission_sample_set in names, False)
......@@ -241,6 +241,13 @@ sec_fake_tag_id = db.tag.insert(name="sec_fake_tag")
db.group_tag.insert(group_id=unique_group, tag_id=first_fake_tag_id)
db.group_tag.insert(group_id=fake_group_id, tag_id=sec_fake_tag_id)
first_fake_tag_ref = db.tag_ref.insert(tag_id = first_fake_tag_id,
table_name = 'patient',
record_id = fake_sample_set_id)
sec_fake_tag_ref = db.tag_ref.insert(tag_id = sec_fake_tag_id,
table_name = 'patient',
record_id = fake_sample_set_id)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment