Skip to content

Commit

Permalink
Merge branch 'reduce_callback_execution' into 0.3.0-release-prep
Browse files Browse the repository at this point in the history
  • Loading branch information
diranged committed Jun 3, 2014
2 parents 947629b + dc10ca9 commit 5097434
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nd_service_registry/watcher_integration.py
Expand Up @@ -149,12 +149,12 @@ def get_data():
self.zk.set(path, value='%s' % i)
waituntil(get_data, {'string_value': '%s' % i}, timeout=5, mode=2)

# The right number of calls is 7. There are a few upfront calls when
# The right number of calls is 6. There are a few upfront calls when
# the Watcher object is initialized, and after that there are a few
# calls for the updated node-data when new children are added. The
# call count would be MUCH higher (11++) if we were recursively
# creating Watches though.
self.assertEquals(7, len(callback_checker.test.mock_calls))
self.assertEquals(6, len(callback_checker.test.mock_calls))

def test_deleting_node_watcher_is_watching(self):
# Create our test path
Expand Down
2 changes: 1 addition & 1 deletion nd_service_registry/watcher_tests.py
Expand Up @@ -42,7 +42,7 @@ def test_execute_callbacks(self):
# Execute the callback method several times. It sohuld only fire off
# once
for i in xrange(0, 5):
self.watch._execute_callbacks()
self.watch._execute_callbacks()

# Executing the callbacks should happen only when the data changes.
self.assertEquals(1, self.callback_watcher.test.call_count)
Expand Down

0 comments on commit 5097434

Please sign in to comment.