Skip to content

Instantly share code, notes, and snippets.

@hub-cap
Created April 12, 2013 20:33
Show Gist options
  • Save hub-cap/5374926 to your computer and use it in GitHub Desktop.
Save hub-cap/5374926 to your computer and use it in GitHub Desktop.
# Now make sure the time is ahead by more than a few millis,¬
# This a good indicator that it has elapsed time more than a¬
# few clock cycles¬
fuzzy_delta = event.created + datetime.timedelta(milliseconds=200)¬
self.assertTrue(fuzzy_delta < event.finish_time)¬
# Now to make doubly sure, lets add a bunch of extra time to it to!¬
# make sure its before the tiem¬
fuzzy_delta = event.created + datetime.timedelta(milliseconds=400)¬
self.assertTrue(fuzzy_delta > event.finish_time)¬
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment