示例#1
0
 def test_eq_different_families_by_name(self):
     """Test that two Family with same name are equal."""
     family_1 = Family()
     family_2 = Family()
     family_1.name = 'a'
     family_2.name = 'a'
     self.assertNotEqual(id(family_1), id(family_2))
     self.assertEqual(family_1, family_2)
示例#2
0
 def test_eq_different_families_by_id(self):
     """Test that two Family with no name attribute are not equal."""
     family_1 = Family()
     family_2 = Family()
     family_1.name = 'a'
     del family_2.name
     self.assertNotEqual(id(family_1), id(family_2))
     self.assertNotEqual(family_1, family_2)
示例#3
0
    def test_set_obsolete(self):
        """Test obsolete can be set."""
        family = Family()
        self.assertEqual(family.obsolete, {})
        self.assertEqual(family.interwiki_replacements, {})
        self.assertEqual(family.interwiki_removals, [])

        family.obsolete = {'a': 'b', 'c': None}
        self.assertEqual(family.obsolete, {'a': 'b', 'c': None})
        self.assertEqual(family.interwiki_replacements, {'a': 'b'})
        self.assertEqual(family.interwiki_removals, ['c'])