Exemplo n.º 1
0
    def test_find_options(self):
        diff = Diff(self, Name('example.org.'))
        name = Name('foo.example.org.')
        rrtype = RRType.TXT()
        options = ZoneFinder.NO_WILDCARD

        self.assertEqual("find_return", diff.find(name, rrtype, options))

        self.assertTrue(self.__find_called)
        self.assertEqual(name, self.__find_name)
        self.assertEqual(rrtype, self.__find_type)
        self.assertEqual(options, self.__find_options)
Exemplo n.º 2
0
    def test_find(self):
        diff = Diff(self, Name('example.org.'))
        name = Name('www.example.org.')
        rrtype = RRType.A()

        self.assertFalse(self.__find_called)
        self.assertEqual(None, self.__find_name)
        self.assertEqual(None, self.__find_type)
        self.assertEqual(None, self.__find_options)

        self.assertEqual("find_return", diff.find(name, rrtype))

        self.assertTrue(self.__find_called)
        self.assertEqual(name, self.__find_name)
        self.assertEqual(rrtype, self.__find_type)
        self.assertEqual(ZoneFinder.NO_WILDCARD | ZoneFinder.FIND_GLUE_OK,
                         self.__find_options)