本文整理汇总了Python中family.Family.addWife方法的典型用法代码示例。如果您正苦于以下问题:Python Family.addWife方法的具体用法?Python Family.addWife怎么用?Python Family.addWife使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类family.Family
的用法示例。
在下文中一共展示了Family.addWife方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OutputTest
# 需要导入模块: from family import Family [as 别名]
# 或者: from family.Family import addWife [as 别名]
class OutputTest(unittest.TestCase):
def setUp(self):
self.indi = Individual()
self.indi.addID('@[email protected]')
self.indi.addName('John Rivas')
self.indi.addSex('M')
self.indi.addBirt('9 MAY 1978')
self.indi.addDeat('12 APR 2013')
self.indi.addFams('@[email protected]')
self.indi.addFamc('@[email protected]')
self.fam1 = Family()
self.fam1.addFamID('@[email protected]')
self.fam1.addHusb('@[email protected]')
self.fam1.addWife('@[email protected]')
self.fam1.addChil('@[email protected]')
self.fam1.addChil('@[email protected]')
self.individuals = dict()
self.individuals["one"] = self.indi
self.families = dict()
self.families["one"] = self.fam1
def test_outputIndiSummary(self):
outputIndiSummary(self.individuals)
def test_outputFamSummary(self):
outputFamSummary(self.families, self.individuals)
示例2: FamilyTest
# 需要导入模块: from family import Family [as 别名]
# 或者: from family.Family import addWife [as 别名]
class FamilyTest(unittest.TestCase):
def setUp(self):
self.fam1 = Family()
self.fam1.addFamID('@[email protected]')
self.fam1.addHusb('@[email protected]')
self.fam1.addWife('@[email protected]')
self.fam1.addChil('@[email protected]')
self.fam1.addChil('@[email protected]')
self.fam1.addMarr('5 OCT 1999')
self.fam1.addDiv('12 JUN 2012')
self.fam2 = Family()
self.fam2.addFamID('@[email protected]')
self.fam2.addHusb('@[email protected]')
self.fam2.addWife('@[email protected]')
""" Test setters """
def test_addFamID(self):
fam = Family()
value = '@[email protected]'
fam.addFamID(value)
self.assertEqual(fam.getFamID(), value)
def test_addHusb(self):
fam = Family()
value = '@[email protected]'
fam.addHusb(value)
self.assertEqual(fam.getHusb(), value)
def test_addWife(self):
fam = Family()
value = '@[email protected]'
fam.addWife(value)
self.assertEqual(fam.getWife(), value)
def test_addChil(self):
fam = Family()
value = '@[email protected]'
fam.addChil(value)
self.assertEqual(fam.getChil()[0], value)
""" Test getters """
def test_getFamID(self):
FAMID = '@[email protected]'
self.assertEqual(self.fam1.getFamID(), FAMID)
fam = Family()
self.assertEqual(fam.getFamID(), None)
def test_getHusb(self):
HUSB = "@[email protected]"
self.assertEqual(self.fam1.getHusb(), HUSB)
fam = Family()
self.assertEqual(fam.getHusb(), None)
def test_getWife(self):
WIFE = "@[email protected]"
self.assertEqual(self.fam1.getWife(), WIFE)
fam = Family()
self.assertEqual(fam.getWife(), None)
def test_getChil(self):
CHIL = ['@[email protected]', '@[email protected]']
self.assertEqual(self.fam1.getChil(), CHIL)
fam = Family()
self.assertEqual(fam.getChil(), [])
def test_getMarr(self):
MARR = '5 OCT 1999'
self.assertEqual(self.fam1.getMarr(), MARR)
fam = Family()
self.assertEqual(fam.getMarr(), None)
def test_getDiv(self):
DIV = '12 JUN 2012'
self.assertEqual(self.fam1.getDiv(), DIV)
fam = Family()
self.assertEqual(fam.getDiv(), None)
示例3: test_addWife
# 需要导入模块: from family import Family [as 别名]
# 或者: from family.Family import addWife [as 别名]
def test_addWife(self):
fam = Family()
value = '@[email protected]'
fam.addWife(value)
self.assertEqual(fam.getWife(), value)
示例4: GedcomTest
# 需要导入模块: from family import Family [as 别名]
# 或者: from family.Family import addWife [as 别名]
class GedcomTest(unittest.TestCase):
def setUp(self):
self.indi1 = Individual()
self.indi1.addID('@[email protected]')
self.indi1.addName('John Rivas')
self.indi1.addSex('M')
self.indi1.addBirt('9 MAY 1978')
self.indi1.addDeat('12 APR 2013')
self.indi2 = Individual()
self.indi2.addID('@[email protected]')
self.indi2.addName('Mary Rivas')
self.indi2.addSex('F')
self.indi2.addBirt('21 APR 1980')
self.indi2.addDeat('12 SEP 1990')
self.indi3 = Individual()
self.indi3.addID('@[email protected]')
self.indi3.addName('Mary Rivas')
self.indi3.addSex('F')
self.indi3.addBirt('21 APR 1980')
self.indi3.addDeat('12 SEP 2014')
self.indi4 = Individual()
self.indi4.addID('@[email protected]')
self.indi4.addName('Mike Rivas')
self.indi4.addSex('M')
self.indi4.addBirt('21 APR 1976')
self.indi5 = Individual()
self.indi5.addID('@[email protected]')
self.indi5.addName('Mike Rivas')
self.indi5.addSex('M')
self.indi5.addBirt('21 APR 2012')
self.indi6 = Individual()
self.indi6.addID('@[email protected]')
self.indi6.addName('Mike Rivas')
self.indi6.addSex('M')
self.indi6.addBirt('21 APR 1988')
self.indi6.addFamc('@[email protected]')
self.indi7 = Individual()
self.indi7.addID('@[email protected]')
self.indi7.addName('Laura Rivas')
self.indi7.addSex('F')
self.indi7.addBirt('21 APR 1990')
self.indi7.addFamc('@[email protected]')
self.indi8 = Individual()
self.indi8.addID('@[email protected]')
self.indi8.addName('Laura Rivas')
self.indi8.addSex('F')
self.indi8.addBirt('21 APR 1990')
self.indi8.addFamc('@[email protected]')
self.individuals = dict()
self.individuals['1'] = self.indi1
self.individuals['2'] = self.indi2
self.individuals['3'] = self.indi3
self.individuals['4'] = self.indi4
self.individuals['5'] = self.indi5
self.individuals['6'] = self.indi6
self.individuals['7'] = self.indi7
self.individuals['8'] = self.indi8
self.fam1 = Family()
self.fam1.addFamID('@[email protected]')
self.fam1.addHusb('@[email protected]')
self.fam1.addWife('@[email protected]')
self.fam1.addChil('@[email protected]')
self.fam1.addChil('@[email protected]')
self.fam1.addMarr('5 OCT 1999')
self.fam1.addDiv('12 JUN 2012')
self.fam2 = Family()
self.fam2.addFamID('@[email protected]')
self.fam2.addHusb('@[email protected]')
self.fam2.addWife('@[email protected]')
self.fam3 = Family()
self.fam3.addFamID('@[email protected]')
self.fam3.addHusb('@[email protected]')
self.fam3.addWife('@[email protected]')
self.fam3.addChil('@[email protected]')
self.fam3.addChil('@[email protected]')
self.fam3.addMarr('5 OCT 1999')
self.fam3.addDiv('12 JUN 2012')
self.fam4 = Family()
self.fam4.addFamID('@[email protected]')
self.fam4.addHusb('@[email protected]')
self.fam4.addWife('@[email protected]')
self.fam4.addChil('@[email protected]')
self.fam4.addMarr('5 OCT 1999')
self.fam4.addDiv('12 JUN 2012')
self.fam5 = Family()
self.fam5.addFamID('@[email protected]')
self.fam5.addHusb('@[email protected]')
self.fam5.addWife('@[email protected]')
self.fam5.addChil('@[email protected]')
self.fam5.addMarr('5 OCT 1999')
self.fam5.addDiv('12 JUN 2012')
def test_checkSameHusbWife(self):
self.assertTrue(checkSameHusbWife(self.fam2))
#.........这里部分代码省略.........