本文整理汇总了Python中individual.Individual.addName方法的典型用法代码示例。如果您正苦于以下问题:Python Individual.addName方法的具体用法?Python Individual.addName怎么用?Python Individual.addName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类individual.Individual
的用法示例。
在下文中一共展示了Individual.addName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OutputTest
# 需要导入模块: from individual import Individual [as 别名]
# 或者: from individual.Individual import addName [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: IndividualTest
# 需要导入模块: from individual import Individual [as 别名]
# 或者: from individual.Individual import addName [as 别名]
class IndividualTest(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]')
""" Test setters """
def test_addID(self):
indi = Individual()
value = '@[email protected]'
indi.addID(value)
self.assertEqual(indi.getID(), value)
def test_addName(self):
indi = Individual()
value = "Gloop"
indi.addName(value)
self.assertEqual(indi.getName(), value)
def test_addSex(self):
indi = Individual()
value = "M"
indi.addSex(value)
self.assertEqual(indi.getSex(), value)
value = "F"
indi.addSex(value)
self.assertEqual(indi.getSex(), value)
def test_addBirt(self):
indi = Individual()
value = "01 JAN 1900"
indi.addBirt(value)
self.assertEqual(indi.getBirt(), value)
def test_addDeat(self):
indi = Individual()
value = "01 JAN 2000"
indi.addDeat(value)
self.assertEqual(indi.getDeat(), value)
def test_addFams(self):
indi = Individual()
value = '@[email protected]'
indi.addFams(value)
self.assertEqual(indi.getFams()[0], value)
def test_addFamc(self):
indi = Individual()
value = '@[email protected]'
indi.addFamc(value)
self.assertEqual(indi.getFamc()[0], value)
""" Test getters """
def test_getID(self):
ID = '@[email protected]'
self.assertEqual(self.indi.getID(), ID)
indi = Individual()
self.assertEqual(indi.getID(), None)
def test_getName(self):
NAME = 'John Rivas'
self.assertEqual(self.indi.getName(), NAME)
indi = Individual()
self.assertEqual(indi.getName(), None)
def test_getSex(self):
SEX = 'M'
self.assertEqual(self.indi.getSex(), SEX)
indi = Individual()
self.assertEqual(indi.getSex(), None)
def test_getBirt(self):
BIRT = '9 MAY 1978'
self.assertEqual(self.indi.getBirt(), BIRT)
indi = Individual()
self.assertEqual(indi.getBirt(), None)
def test_getDeat(self):
DEAT = '12 APR 2013'
self.assertEqual(self.indi.getDeat(), DEAT)
indi = Individual()
self.assertEqual(indi.getDeat(), None)
def test_getFams(self):
FAMS = ['@[email protected]']
#.........这里部分代码省略.........
示例3: GedcomTest
# 需要导入模块: from individual import Individual [as 别名]
# 或者: from individual.Individual import addName [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))
#.........这里部分代码省略.........
示例4: test_addName
# 需要导入模块: from individual import Individual [as 别名]
# 或者: from individual.Individual import addName [as 别名]
def test_addName(self):
indi = Individual()
value = "Gloop"
indi.addName(value)
self.assertEqual(indi.getName(), value)