<s> import unittest2 as unittest <EOL> import pytz <EOL> from . . import tztime <EOL> JAN_MICROS = <NUM_LIT> * <NUM_LIT:1000> ** <NUM_LIT:2> <EOL> JAN_MILLIS = JAN_MICROS / <NUM_LIT:1000> <EOL> JAN_SECS = JAN_MILLIS / <NUM_LIT:1000> <EOL> JUL_MICROS = <NUM_LIT> * <NUM_LIT:1000> ** <NUM_LIT:2> <EOL> HOUR_MICROS = <NUM_LIT> ** <NUM_LIT:2> * <NUM_LIT:1000> ** <NUM_LIT:2> <EOL> NY_JAN_MICROS = JAN_MICROS + HOUR_MICROS * <NUM_LIT:5> <EOL> NY_JUL_MICROS = JUL_MICROS + HOUR_MICROS * <NUM_LIT:4> <EOL> TZ_UTC = pytz . utc <EOL> TZ_NY = pytz . timezone ( '<STR_LIT>' ) <EOL> TZ_AC = pytz . timezone ( '<STR_LIT>' ) <EOL> class SaneTzTimeTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : pass <EOL> def test_clone ( self ) : <EOL> self . assertEquals ( tztime , type ( tztime ( JAN_MICROS , TZ_UTC ) . clone ( ) ) ) <EOL> def test_equality ( self ) : <EOL> t1 = tztime ( JAN_MICROS , tz = '<STR_LIT>' ) <EOL> t2 = tztime ( JAN_MICROS , tz = '<STR_LIT>' ) <EOL> t3 = tztime ( JAN_MICROS + <NUM_LIT:1> ) <EOL> self . assertTrue ( t1 == t1 ) <EOL> self . assertTrue ( t2 == t2 ) <EOL> self . assertTrue ( t3 == t3 ) <EOL> self . assertFalse ( t1 != t1 ) <EOL> self . assertFalse ( t2 != t2 ) <EOL> self . assertFalse ( t3 != t3 ) <EOL> self . assertTrue ( t1 != t2 ) <EOL> self . assertTrue ( t2 != t1 ) <EOL> self . assertTrue ( t1 != t3 ) <EOL> self . assertTrue ( t3 != t1 ) <EOL> self . assertTrue ( t2 != t3 ) <EOL> self . assertTrue ( t3 != t2 ) <EOL> self . assertFalse ( t1 == t2 ) <EOL> self . assertFalse ( t2 == t1 ) <EOL> self . assertFalse ( t1 == t3 ) <EOL> self . assertFalse ( t3 == t1 ) <EOL> self . assertFalse ( t2 == t3 ) <EOL> self . assertFalse ( t3 == t2 ) <EOL> self . assertTrue ( t1 != None ) <EOL> self . assertFalse ( t1 == None ) <EOL> self . assertTrue ( None != t1 ) <EOL> self . assertFalse ( None == t1 ) <EOL> self . assertTrue ( t1 == t1 . us ) <EOL> def test_comparisons ( self ) : <EOL> t1 = tztime ( JAN_MICROS , '<STR_LIT>' ) <EOL> t2 = tztime ( JAN_MICROS , '<STR_LIT>' ) <EOL> t3 = tztime ( JAN_MICROS + <NUM_LIT:1> , '<STR_LIT>' ) <EOL> self . assertFalse ( t1 > t1 ) <EOL> self . assertFalse ( t2 > t2 ) <EOL> self . assertFalse ( t3 > t3 ) <EOL> self . assertTrue ( t1 > t2 ) <EOL> self . assertFalse ( t2 > t1 ) <EOL> self . assertFalse ( t1 > t3 ) <EOL> self . assertTrue ( t3 > t1 ) <EOL> self . assertFalse ( t2 > t3 ) <EOL> self . assertTrue ( t3 > t2 ) <EOL> self . assertTrue ( t1 >= t1 ) <EOL> self . assertTrue ( t2 >= t2 ) <EOL> self . assertTrue ( t3 >= t3 ) <EOL> self . assertTrue ( t1 >= t2 ) <EOL> self . assertFalse ( t2 >= t1 ) <EOL> self . assertFalse ( t1 >= t3 ) <EOL> self . assertTrue ( t3 >= t1 ) <EOL> self . assertFalse ( t2 >= t3 ) <EOL> self . assertTrue ( t3 >= t2 ) <EOL> self . assertTrue ( t1 <= t1 ) <EOL> self . assertTrue ( t2 <= t2 ) <EOL> self . assertTrue ( t3 <= t3 ) <EOL> self . assertFalse ( t1 <= t2 ) <EOL> self . assertTrue ( t2 <= t1 ) <EOL> self . assertTrue ( t1 <= t3 ) <EOL> self . assertFalse ( t3 <= t1 ) <EOL> self . assertTrue ( t2 <= t3 ) <EOL> self . assertFalse ( t3 <= t2 ) <EOL> self . assertFalse ( t1 < t1 ) <EOL> self . assertFalse ( t2 < t2 ) <EOL> self . assertFalse ( t3 < t3 ) <EOL> self . assertFalse ( t1 < t2 ) <EOL> self . assertTrue ( t2 < t1 ) <EOL> self . assertTrue ( t1 < t3 ) <EOL> self . assertFalse ( t3 < t1 ) <EOL> self . assertTrue ( t2 < t3 ) <EOL> self . assertFalse ( t3 < t2 ) <EOL> def test_hashability ( self ) : <EOL> t1 = tztime ( JAN_MICROS , tz = '<STR_LIT>' ) <EOL> t2 = tztime ( JAN_MICROS , tz = '<STR_LIT>' ) <EOL> t3 = tztime ( JAN_MICROS + <NUM_LIT:1> ) <EOL> s = set ( [ t1 , t2 , t3 ] ) <EOL> self . assertEquals ( <NUM_LIT:3> , len ( s ) ) <EOL> self . assertIn ( t1 , s ) <EOL> self . assertIn ( t2 , s ) <EOL> self . assertIn ( t3 , s ) </s>
