Permalink
Browse files

Update writer unit tests to test call data equality

Samples written by the writer should have the exact same data before and after
they are parsed. Previously this was not tested, since call data equality
testing only checks for the sample name, genotype, and record (and not other
data fields).
  • Loading branch information...
1 parent 53548b6 commit 3540bb7feb13e21cb993770966d5d86992d95a44 @bow bow committed Jan 30, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 vcf/test/test_vcf.py
View
@@ -232,6 +232,11 @@ def testWrite(self):
for l, r in zip(records, reader2):
self.assertEquals(l.samples, r.samples)
+ # test for call data equality, since equality on the sample calls
+ # may not always mean their data are all equal
+ for l_call, r_call in zip(l.samples, r.samples):
+ self.assertEqual(l_call.data, r_call.data)
+
class TestBcfToolsOutputWriter(unittest.TestCase):
@@ -256,6 +261,11 @@ def testWrite(self):
for l, r in zip(records, reader2):
self.assertEquals(l.samples, r.samples)
+ # test for call data equality, since equality on the sample calls
+ # may not always mean their data are all equal
+ for l_call, r_call in zip(l.samples, r.samples):
+ self.assertEqual(l_call.data, r_call.data)
+
class TestWriterDictionaryMeta(unittest.TestCase):

0 comments on commit 3540bb7

Please sign in to comment.