diff --git a/test_ago.py b/test_ago.py index 31972ce..6db679e 100644 --- a/test_ago.py +++ b/test_ago.py @@ -1,17 +1,11 @@ +from __future__ import print_function + from datetime import datetime from datetime import timedelta from ago import human from ago import delta2dict -try: - from types import StringType as STRING - from types import DictType as DICT -except ImportError: - import builtins - STRING = builtins.str - DICT = builtins.dict - # datetime objects PRESENT = datetime.now() PAST = PRESENT - timedelta( 492, 58711, 45 ) # days, secs, ms @@ -23,13 +17,13 @@ FUTURE_DELTA = PRESENT - FUTURE ONE_YEAR_FOUR_HOURS_DELTA = timedelta( 365, 14400, 0 ) def test_human_passed_datetime_is_string(): - assert type(human( PAST )) is STRING + assert isinstance(human( PAST ), str) def test_human_passed_timedelta_is_string(): - assert type(human( PAST_DELTA )) is STRING + assert isinstance(human( PAST_DELTA ), str) def test_delta2dict_is_dict(): - assert type(delta2dict( PAST_DELTA )) is DICT + assert isinstance(delta2dict( PAST_DELTA ), dict) def test_ago_in_past_human(): assert 'ago' in human( PAST )