<s> from datetime import datetime <EOL> from nose . tools import eq_ <EOL> from kitsune . customercare . templatetags . jinja_helpers import isotime , round_percent , utctimesince <EOL> from kitsune . sumo . tests import TestCase <EOL> def test_isotime ( ) : <EOL> """<STR_LIT>""" <EOL> time = datetime ( <NUM_LIT> , <NUM_LIT:12> , <NUM_LIT> , <NUM_LIT:10> , <NUM_LIT:11> , <NUM_LIT:12> ) <EOL> eq_ ( isotime ( time ) , '<STR_LIT>' ) <EOL> assert isotime ( None ) is None <EOL> class RoundPercentTests ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_high_percent_int ( self ) : <EOL> eq_ ( '<STR_LIT>' , str ( round_percent ( <NUM_LIT> ) ) ) <EOL> def test_high_percent_float ( self ) : <EOL> eq_ ( '<STR_LIT>' , str ( round_percent ( <NUM_LIT> ) ) ) <EOL> def test_low_percent_int ( self ) : <EOL> eq_ ( '<STR_LIT>' , str ( round_percent ( <NUM_LIT:6> ) ) ) <EOL> def test_low_percent_float ( self ) : <EOL> eq_ ( '<STR_LIT>' , str ( round_percent ( <NUM_LIT> ) ) ) <EOL> class UTCTimesinceTests ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> def test_none ( self ) : <EOL> """<STR_LIT>""" <EOL> eq_ ( '<STR_LIT>' , utctimesince ( None ) ) <EOL> def test_trunc ( self ) : <EOL> """<STR_LIT>""" <EOL> eq_ ( '<STR_LIT>' , <EOL> utctimesince ( datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:2> ) , now = datetime ( <NUM_LIT> , <NUM_LIT:2> , <NUM_LIT:3> ) ) ) <EOL> def test_future ( self ) : <EOL> """<STR_LIT>""" <EOL> eq_ ( '<STR_LIT>' , utctimesince ( datetime ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:2> ) ) ) </s>
