Commits

Russell Ballestrini committed 915a8dc

Fixed test to use types

  • Participants
  • Parent commits 0bf10a2

Comments (0)

Files changed (1)

+from datetime import datetime
+from datetime import timedelta
+
+from types import *
+
 from ago import human
 from ago import delta2human
 from ago import delta2dict
 
-from datetime import datetime
-from datetime import timedelta
-
 PRESENT = datetime.now()
 PAST    = PRESENT - timedelta( 492, 58711, 45 ) # days, secs, ms
 FUTURE  = PRESENT + timedelta( 2, 12447, 963 ) # days, secs, ms
 FUTURE_DELTA = PRESENT - FUTURE
 
 def test_human_is_string():
-    assert 'str' in str(type(human( PAST )))
+    assert type(human( PAST )) is StringType
 
 def test_delta2human_is_string():
-    assert 'str' in str(type(delta2human( PAST_DELTA )))
+    assert type(delta2human( PAST_DELTA )) is StringType
 
 def test_delta2dict_is_dict():
-    assert 'dict' in str(type(delta2dict( PAST_DELTA )))
+    assert type(delta2dict( PAST_DELTA )) is DictType
 
 def test_ago_in_past_human():
     assert 'ago' in human( PAST )