Example #1
0
 def test_get_rrset_collection(self):
     '''
     Test the diff can return corresponding rrset collection. Test
     it applies the data first.
     '''
     diff = Diff(self, Name('example.org'), single_update_mode=True)
     diff.add_data(self.__rrset_soa)
     collection = diff.get_rrset_collection()
     # Check it is applied
     self.assertEqual(1, len(self.__data_operations))
     self.assertEqual('add', self.__data_operations[0][0])
     # Check the returned one is actually RRsetCollection
     self.assertTrue(isinstance(collection, self.Collection))
     # The collection is just the mock from above, so this doesn't do much
     # testing, but we check that the mock got through and didn't get hurt.
     self.assertIsNone(collection.find(Name('example.org'), RRClass.IN,
                                       RRType.SOA))