BIND 10 trac2856, updated. d4fba54ddee752b447164bbed089735f2999f28b [2856] Add start_update() tests
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jul 8 12:19:01 UTC 2013
The branch, trac2856 has been updated
via d4fba54ddee752b447164bbed089735f2999f28b (commit)
from fd38783ce713c1ee718805cd5cc7bd33b07dbc4c (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 d4fba54ddee752b447164bbed089735f2999f28b
Author: Mukund Sivaraman <muks at isc.org>
Date: Mon Jul 8 17:46:08 2013 +0530
[2856] Add start_update() tests
-----------------------------------------------------------------------
Summary of changes:
.../python/isc/memmgr/tests/datasrc_info_tests.py | 41 +++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
-----------------------------------------------------------------------
diff --git a/src/lib/python/isc/memmgr/tests/datasrc_info_tests.py b/src/lib/python/isc/memmgr/tests/datasrc_info_tests.py
index 77470d3..9e36647 100644
--- a/src/lib/python/isc/memmgr/tests/datasrc_info_tests.py
+++ b/src/lib/python/isc/memmgr/tests/datasrc_info_tests.py
@@ -117,6 +117,45 @@ class TestSegmentInfo(unittest.TestCase):
# none of this touches the old readers
self.assertSetEqual(self.__sgmt_info.get_old_readers(), set())
+ def test_start_update(self):
+ # in READY state
+ # a) there are no events
+ self.__si_to_ready_state()
+ e = self.__sgmt_info.start_update()
+ self.assertIsNone(e)
+ # if there are no events, there is nothing to update
+ self.assertEqual(self.__sgmt_info.get_state(), SegmentInfo.READY)
+
+ # b) there are events. this is the same as calling
+ # self.__si_to_updating_state(), but let's try to be
+ # descriptive.
+ self.__si_to_ready_state()
+ self.__sgmt_info.add_event((42,))
+ e = self.__sgmt_info.start_update()
+ self.assertTupleEqual(e, (42,))
+ self.assertEqual(self.__sgmt_info.get_state(), SegmentInfo.UPDATING)
+
+ # in UPDATING state, it should always return None and not change
+ # state.
+ self.__si_to_updating_state()
+ e = self.__sgmt_info.start_update()
+ self.assertIsNone(e)
+ self.assertEqual(self.__sgmt_info.get_state(), SegmentInfo.UPDATING)
+
+ # in SYNCHRONIZING state, it should always return None and not
+ # change state.
+ self.__si_to_synchronizing_state()
+ e = self.__sgmt_info.start_update()
+ self.assertIsNone(e)
+ self.assertEqual(self.__sgmt_info.get_state(), SegmentInfo.SYNCHRONIZING)
+
+ # in COPYING state, it should always return None and not
+ # change state.
+ self.__si_to_copying_state()
+ e = self.__sgmt_info.start_update()
+ self.assertIsNone(e)
+ self.assertEqual(self.__sgmt_info.get_state(), SegmentInfo.COPYING)
+
def test_complete_update(self):
# in READY state
self.__si_to_ready_state()
@@ -124,7 +163,7 @@ class TestSegmentInfo(unittest.TestCase):
# in UPDATING state this is the same as calling
# self.__si_to_synchronizing_state(), but let's try to be
- # descriptive
+ # descriptive.
#
# a) with no events
self.__si_to_updating_state()
More information about the bind10-changes
mailing list