本文整理汇总了Python中family.Family.getWife方法的典型用法代码示例。如果您正苦于以下问题:Python Family.getWife方法的具体用法?Python Family.getWife怎么用?Python Family.getWife使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类family.Family
的用法示例。
在下文中一共展示了Family.getWife方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_addWife
# 需要导入模块: from family import Family [as 别名]
# 或者: from family.Family import getWife [as 别名]
def test_addWife(self):
fam = Family()
value = '@[email protected]'
fam.addWife(value)
self.assertEqual(fam.getWife(), value)
示例2: test_getWife
# 需要导入模块: from family import Family [as 别名]
# 或者: from family.Family import getWife [as 别名]
def test_getWife(self):
WIFE = "@[email protected]"
self.assertEqual(self.fam1.getWife(), WIFE)
fam = Family()
self.assertEqual(fam.getWife(), None)
示例3: FamilyTest
# 需要导入模块: from family import Family [as 别名]
# 或者: from family.Family import getWife [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)