Skip to content

Commit

Permalink
added unit tests to guard against earlier bug. Bumped version number
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremymcrae committed Feb 16, 2018
1 parent a77771f commit 44179f0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup (name="peds",
description='Package for parsing pedigree files',
version="1.1.0",
version="1.2.0",
author="Jeremy McRae",
author_email="jmcrae@illumina.com",
url='https://github.com/jeremymcrae/peds',
Expand Down
32 changes: 32 additions & 0 deletions tests/test_family.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ def test_get_mother(self):
# despite a mother being present, there is still not father
self.assertIsNone(fam.get_father(child))

def test_set_mother_placeholder(self):
""" check the mother when set with a placeholder mother
"""

fam = Family('A')
child = Person('A', 'B', '0', 'C', '1', '1')
mother = Person('A', 'C', '0', '0', '2', '1')
placeholder = Person('A', 'C', 'NA', 'NA', 'NA', 'NA')
fam.add_person(child)
fam.add_person(mother)

fam.set_mom(placeholder, child)

# and check we can still pick up the parent.
self.assertIsNotNone(fam.get_mother(child))

def test_get_father(self):
""" test getting a father
"""
Expand All @@ -76,6 +92,22 @@ def test_get_father(self):
# despite a father being present, there is still not mother
self.assertIsNone(fam.get_mother(child))

def test_set_mother_placeholder(self):
""" check the father when set with a placeholder father
"""

fam = Family('A')
child = Person('A', 'B', 'C', '0', '1', '1')
father = Person('A', 'C', '0', '0', '1', '1')
placeholder = Person('A', 'C', 'NA', 'NA', 'NA', 'NA')
fam.add_person(child)
fam.add_person(father)

fam.set_dad(placeholder, child)

# and check we can still pick up the parent.
self.assertIsNotNone(fam.get_father(child))

def test_get_children(self):
""" test getting children
"""
Expand Down

0 comments on commit 44179f0

Please sign in to comment.