Advertisement
Guest User

test-time.py

a guest
Oct 25th, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. #!/usr/bin/env python3
  2.  
  3. from datetime import *
  4.  
  5. correct = {
  6.   1413769091: 'Mon Oct 20 05:38:11 2014',
  7.   1414633091: 'Thu Oct 30 04:38:11 2014'
  8. }
  9.  
  10. for ts in sorted (correct.keys ()):
  11.     value = datetime.fromtimestamp (ts).ctime()
  12.     if value == correct[ts]:
  13.         continue
  14.     print ("fail: ts=%d, value='%s', correct='%s'" % (ts, value, correct[ts]))
  15.     assert value == correct[ts]
  16. print ("ok")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement