Parcourir la source

[1372] simplified the code of MockDataSrcClient.find() and updated the
docstring accordingly.

JINMEI Tatuya il y a 13 ans
Parent
commit
5d382b4295
1 fichiers modifiés avec 6 ajouts et 6 suppressions
  1. 6 6
      src/bin/xfrout/tests/xfrout_test.py.in

+ 6 - 6
src/bin/xfrout/tests/xfrout_test.py.in

@@ -110,21 +110,21 @@ class MockDataSrcClient:
     def find(self, name, rrtype, target, options):
         '''Mock ZoneFinder.find().
 
-        It returns the predefined SOA RRset to queries for SOA of the common
-        test zone name.  It also emulates some unusual cases for special
+        (At the moment) this method only handles query for type SOA.
+        By default it returns a normal SOA RR(set) whose owner name is
+        the query name  It also emulates some unusual cases for special
         zone names.
 
         '''
-        if name == TEST_ZONE_NAME and rrtype == RRType.SOA():
-            return (ZoneFinder.SUCCESS, self.__create_soa())
-        elif name == Name('nosoa.example.com') and rrtype == RRType.SOA():
+        if name == Name('nosoa.example.com') and rrtype == RRType.SOA():
             return (ZoneFinder.NXDOMAIN, None)
         elif name == Name('multisoa.example.com') and rrtype == RRType.SOA():
             soa_rrset = self.__create_soa()
             soa_rrset.add_rdata(soa_rrset.get_rdata()[0])
             return (ZoneFinder.SUCCESS, soa_rrset)
-        else:
+        elif rrtype == RRType.SOA():
             return (ZoneFinder.SUCCESS, self.__create_soa())
+        raise ValueError('Unexpected input to mock finder: bug in test case?')
 
     def get_iterator(self, zone_name, adjust_ttl=False):
         if zone_name == Name('notauth.example.com'):