Skip to content

Commit

Permalink
add tests for last_modified handling
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Mar 22, 2012
1 parent a8e3c49 commit 7d55c3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zktools/tests/test_node.py
Expand Up @@ -27,13 +27,17 @@ def testUpdateValue(self):
n2 = self.makeOne('/zkTestNode')

eq_(n1.value, n2.value)
eq_(n1.last_modified, n2.last_modified)

old_modified = n1.last_modified
n1.value = 942

# It can take a fraction of a second on some machines on occasion
# for the other value to update
time.sleep(0.1)
eq_(n1.value, n2.value)
eq_(n1.last_modified, n2.last_modified)
self.assertTrue(n1.last_modified > old_modified)

def testJsonValue(self):
n1 = self.makeOne('/zkTestNode', use_json=True)
Expand Down

0 comments on commit 7d55c3f

Please sign in to comment.