Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- from datetime import *
- correct = {
- 1413769091: 'Mon Oct 20 05:38:11 2014',
- 1414633091: 'Thu Oct 30 04:38:11 2014'
- }
- for ts in sorted (correct.keys ()):
- value = datetime.fromtimestamp (ts).ctime()
- if value == correct[ts]:
- continue
- print ("fail: ts=%d, value='%s', correct='%s'" % (ts, value, correct[ts]))
- assert value == correct[ts]
- print ("ok")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement