Browse Source

[master] adjust latest code for the changes to isc.dns python constants.

with one minor regression fix.
JINMEI Tatuya 12 years ago
parent
commit
733d42fa3d

+ 4 - 6
src/bin/xfrin/tests/xfrin_test.py

@@ -1316,8 +1316,7 @@ class TestAXFR(TestXfrinConnection):
         a_rr = self._create_a('192.0.2.1')
         a_rr = self._create_a('192.0.2.1')
         self.conn._send_query(RRType.AXFR)
         self.conn._send_query(RRType.AXFR)
         self.conn.reply_data = self.conn.create_response_data(
         self.conn.reply_data = self.conn.create_response_data(
-            questions=[Question(TEST_ZONE_NAME, TEST_RRCLASS,
-                                RRType.AXFR)],
+            questions=[Question(TEST_ZONE_NAME, TEST_RRCLASS, RRType.AXFR)],
             # begin serial=1230, end serial=1234. end will be used.
             # begin serial=1230, end serial=1234. end will be used.
             answers=[begin_soa_rrset, ns_rr, a_rr, soa_rrset])
             answers=[begin_soa_rrset, ns_rr, a_rr, soa_rrset])
         self.conn._handle_xfrin_responses()
         self.conn._handle_xfrin_responses()
@@ -1331,10 +1330,9 @@ class TestAXFR(TestXfrinConnection):
         Test we reject a zone transfer if it fails the check_zone validation.
         Test we reject a zone transfer if it fails the check_zone validation.
         """
         """
         a_rr = self._create_a('192.0.2.1')
         a_rr = self._create_a('192.0.2.1')
-        self.conn._send_query(RRType.AXFR())
+        self.conn._send_query(RRType.AXFR)
         self.conn.reply_data = self.conn.create_response_data(
         self.conn.reply_data = self.conn.create_response_data(
-            questions=[Question(TEST_ZONE_NAME, TEST_RRCLASS,
-                                RRType.AXFR())],
+            questions=[Question(TEST_ZONE_NAME, TEST_RRCLASS, RRType.AXFR)],
             # begin serial=1230, end serial=1234. end will be used.
             # begin serial=1230, end serial=1234. end will be used.
             answers=[begin_soa_rrset, a_rr, soa_rrset])
             answers=[begin_soa_rrset, a_rr, soa_rrset])
         # Make it fail the validation
         # Make it fail the validation
@@ -1646,7 +1644,7 @@ class TestIXFRResponse(TestXfrinConnection):
         An IXFR that fails validation later on. Check it is rejected.
         An IXFR that fails validation later on. Check it is rejected.
         '''
         '''
         self.conn.reply_data = self.conn.create_response_data(
         self.conn.reply_data = self.conn.create_response_data(
-            questions=[Question(TEST_ZONE_NAME, TEST_RRCLASS, RRType.IXFR())],
+            questions=[Question(TEST_ZONE_NAME, TEST_RRCLASS, RRType.IXFR)],
             answers=[soa_rrset, begin_soa_rrset, soa_rrset, soa_rrset])
             answers=[soa_rrset, begin_soa_rrset, soa_rrset, soa_rrset])
         self._check_zone_result = False
         self._check_zone_result = False
         self.assertRaises(XfrinZoneError, self.conn._handle_xfrin_responses)
         self.assertRaises(XfrinZoneError, self.conn._handle_xfrin_responses)

+ 1 - 1
src/lib/python/isc/ddns/tests/session_tests.py

@@ -704,7 +704,7 @@ class SessionTest(SessionTestBase):
         rrset_exists_value_1 = create_rrset("example.org", RRClass.IN,
         rrset_exists_value_1 = create_rrset("example.org", RRClass.IN,
                                             RRType.NS, 0, ["ns1.example.org."])
                                             RRType.NS, 0, ["ns1.example.org."])
         rrset_exists_value_2 = create_rrset("example.org", RRClass.IN,
         rrset_exists_value_2 = create_rrset("example.org", RRClass.IN,
-                                            RRType.NS, 0, "ns2.example.org."])
+                                            RRType.NS, 0, ["ns2.example.org."])
         rrset_exists_value_3 = create_rrset("example.org", RRClass.IN,
         rrset_exists_value_3 = create_rrset("example.org", RRClass.IN,
                                             RRType.NS, 0, ["ns3.example.org."])
                                             RRType.NS, 0, ["ns3.example.org."])
 
 

+ 2 - 2
src/lib/python/isc/xfrin/tests/diff_tests.py

@@ -1131,8 +1131,8 @@ class DiffTest(unittest.TestCase):
         self.assertTrue(isinstance(collection, self.Collection))
         self.assertTrue(isinstance(collection, self.Collection))
         # The collection is just the mock from above, so this doesn't do much
         # 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.
         # 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()))
+        self.assertIsNone(collection.find(Name('example.org'), RRClass.IN,
+                                          RRType.SOA))
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
     isc.log.init("bind10")
     isc.log.init("bind10")