当前位置: 首页>>代码示例>>Python>>正文


Python Family.getFamID方法代码示例

本文整理汇总了Python中family.Family.getFamID方法的典型用法代码示例。如果您正苦于以下问题:Python Family.getFamID方法的具体用法?Python Family.getFamID怎么用?Python Family.getFamID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在family.Family的用法示例。


在下文中一共展示了Family.getFamID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: FamilyTest

# 需要导入模块: from family import Family [as 别名]
# 或者: from family.Family import getFamID [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)
开发者ID:puterdewd,项目名称:gedcom,代码行数:88,代码来源:familyTest.py

示例2: test_getFamID

# 需要导入模块: from family import Family [as 别名]
# 或者: from family.Family import getFamID [as 别名]
 def test_getFamID(self):
     FAMID = '@[email protected]'
     self.assertEqual(self.fam1.getFamID(), FAMID)
     
     fam = Family()
     self.assertEqual(fam.getFamID(), None)
开发者ID:puterdewd,项目名称:gedcom,代码行数:8,代码来源:familyTest.py

示例3: test_addFamID

# 需要导入模块: from family import Family [as 别名]
# 或者: from family.Family import getFamID [as 别名]
 def test_addFamID(self):
     fam = Family()
     value = '@[email protected]'
     fam.addFamID(value)
     self.assertEqual(fam.getFamID(), value)
开发者ID:puterdewd,项目名称:gedcom,代码行数:7,代码来源:familyTest.py


注:本文中的family.Family.getFamID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。