BIND 10 trac2853, updated. 58335cecf1afa60e325b5ce952b23b40416bd4b9 [2853] Remove redundant code
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Jun 6 19:49:31 UTC 2013
The branch, trac2853 has been updated
via 58335cecf1afa60e325b5ce952b23b40416bd4b9 (commit)
from 632a5596298f9d253693631606e026e01d8e7fdd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 58335cecf1afa60e325b5ce952b23b40416bd4b9
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Jun 7 01:19:14 2013 +0530
[2853] Remove redundant code
-----------------------------------------------------------------------
Summary of changes:
.../python/isc/datasrc/tests/clientlist_test.py | 72 +++++---------------
1 file changed, 18 insertions(+), 54 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/python/isc/datasrc/tests/clientlist_test.py b/src/lib/python/isc/datasrc/tests/clientlist_test.py
index b874ccb..bd53c42 100644
--- a/src/lib/python/isc/datasrc/tests/clientlist_test.py
+++ b/src/lib/python/isc/datasrc/tests/clientlist_test.py
@@ -97,19 +97,7 @@ class ClientListTest(unittest.TestCase):
self.assertRaises(TypeError, self.clist.configure, "[]")
self.assertRaises(TypeError, self.clist.configure, "[]", "true")
- def test_find(self):
- """
- Test the find accepts the right arguments, some of them can be omitted,
- etc.
- """
- self.clist = isc.datasrc.ConfigurableClientList(isc.dns.RRClass.IN)
- self.clist.configure('''[{
- "type": "MasterFiles",
- "params": {
- "example.org": "''' + TESTDATA_PATH + '''example.org.zone"
- },
- "cache-enable": true
- }]''', True)
+ def find_helper(self):
dsrc, finder, exact = self.clist.find(isc.dns.Name("sub.example.org"))
self.assertIsNotNone(dsrc)
self.assertTrue(isinstance(dsrc, isc.datasrc.DataSourceClient))
@@ -151,6 +139,22 @@ class ClientListTest(unittest.TestCase):
self.assertRaises(TypeError, self.clist.find, "example.org")
self.assertRaises(TypeError, self.clist.find)
+ def test_find(self):
+ """
+ Test the find accepts the right arguments, some of them can be omitted,
+ etc.
+ """
+ self.clist = isc.datasrc.ConfigurableClientList(isc.dns.RRClass.IN)
+ self.clist.configure('''[{
+ "type": "MasterFiles",
+ "params": {
+ "example.org": "''' + TESTDATA_PATH + '''example.org.zone"
+ },
+ "cache-enable": true
+ }]''', True)
+
+ self.find_helper()
+
def test_find_mapped(self):
"""
Test find on a mapped segment.
@@ -178,47 +182,7 @@ class ClientListTest(unittest.TestCase):
self.assertEqual(isc.datasrc.ConfigurableClientList.CACHE_STATUS_CACHE_NOT_WRITABLE, result[0])
# The segment is still in READ_ONLY mode.
-
- dsrc, finder, exact = self.clist.find(isc.dns.Name("sub.example.org"))
- self.assertIsNotNone(dsrc)
- self.assertTrue(isinstance(dsrc, isc.datasrc.DataSourceClient))
- self.assertIsNotNone(finder)
- self.assertTrue(isinstance(finder, isc.datasrc.ZoneFinder))
- # Check the finder holds a reference to the data source
- # Note that one reference is kept in the parameter list
- # of getrefcount
- self.assertEqual(3, sys.getrefcount(dsrc))
- finder = None
- self.assertEqual(2, sys.getrefcount(dsrc))
- # We check an exact match in test_configure already
- self.assertFalse(exact)
- self.dsrc, self.finder, exact = \
- self.clist.find(isc.dns.Name("sub.example.org"), False)
- self.assertIsNotNone(self.dsrc)
- self.assertTrue(isinstance(self.dsrc, isc.datasrc.DataSourceClient))
- self.assertIsNotNone(self.finder)
- self.assertTrue(isinstance(self.finder, isc.datasrc.ZoneFinder))
- self.assertFalse(exact)
- self.dsrc, self.finder, exact = \
- self.clist.find(isc.dns.Name("sub.example.org"), True)
- self.assertIsNone(self.dsrc)
- self.assertIsNone(self.finder)
- self.assertFalse(exact)
- self.dsrc, self.finder, exact = \
- self.clist.find(isc.dns.Name("sub.example.org"), False, False)
- self.assertIsNotNone(self.dsrc)
- self.assertTrue(isinstance(self.dsrc, isc.datasrc.DataSourceClient))
- self.assertIsNotNone(self.finder)
- self.assertTrue(isinstance(self.finder, isc.datasrc.ZoneFinder))
- self.assertFalse(exact)
- self.dsrc, self.finder, exact = \
- self.clist.find(isc.dns.Name("sub.example.org"), True, False)
- self.assertIsNone(self.dsrc)
- self.assertIsNone(self.finder)
- self.assertFalse(exact)
- # Some invalid inputs
- self.assertRaises(TypeError, self.clist.find, "example.org")
- self.assertRaises(TypeError, self.clist.find)
+ self.find_helper()
if __name__ == "__main__":
isc.log.init("bind10")
More information about the bind10-changes
mailing list