當前位置: 首頁>>代碼示例>>Python>>正文


Python Family.getDiv方法代碼示例

本文整理匯總了Python中family.Family.getDiv方法的典型用法代碼示例。如果您正苦於以下問題:Python Family.getDiv方法的具體用法?Python Family.getDiv怎麽用?Python Family.getDiv使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在family.Family的用法示例。


在下文中一共展示了Family.getDiv方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_getDiv

# 需要導入模塊: from family import Family [as 別名]
# 或者: from family.Family import getDiv [as 別名]
 def test_getDiv(self):
     DIV = '12 JUN 2012'
     self.assertEqual(self.fam1.getDiv(), DIV)
     
     fam = Family()
     self.assertEqual(fam.getDiv(), None)
開發者ID:puterdewd,項目名稱:gedcom,代碼行數:8,代碼來源:familyTest.py

示例2: FamilyTest

# 需要導入模塊: from family import Family [as 別名]
# 或者: from family.Family import getDiv [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


注:本文中的family.Family.getDiv方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。