Browse Source

[2437] use a string for the default of test find_result.

it's probably more intuitive than False.
JINMEI Tatuya 12 years ago
parent
commit
6e4caf9dd4
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/lib/dns/python/tests/zone_checker_python_test.py

+ 5 - 4
src/lib/dns/python/tests/zone_checker_python_test.py

@@ -119,17 +119,18 @@ class ZoneCheckerTest(unittest.TestCase):
             # This is the Python-only collection class.  Its find() makes
             # the check pass by default, by returning hardcoded RRsets.
             # If raise_on_find is set to True, find() raises an exception.
-            # If find_result is set to something other than False, find()
-            # returns that specified value.
+            # If find_result is set to something other than 'use_default'
+            # (as a string), find() returns that specified value (note that
+            # it can be None).
 
-            def __init__(self, raise_on_find=False, find_result=False):
+            def __init__(self, raise_on_find=False, find_result='use_default'):
                 self.__raise_on_find = raise_on_find
                 self.__find_result = find_result
 
             def find(self, name, rrclass, rrtype):
                 if self.__raise_on_find:
                     raise FakeException('find error')
-                if self.__find_result is not False:
+                if self.__find_result is not 'use_default':
                     return self.__find_result
                 if rrtype == RRType.SOA():
                     soa = RRset(Name('example'), RRClass.IN(), rrtype,