<s> """<STR_LIT>""" <EOL> import unittest <EOL> from smpp . pdu import smpp_time <EOL> from datetime import datetime , timedelta <EOL> class SMPPTimeTest ( unittest . TestCase ) : <EOL> def test_parse_t ( self ) : <EOL> self . assertEquals ( <NUM_LIT:0> , smpp_time . parse_t ( '<STR_LIT:0>' ) ) <EOL> self . assertEquals ( '<STR_LIT:0>' , smpp_time . unparse_t ( <NUM_LIT:0> ) ) <EOL> self . assertEquals ( <NUM_LIT:9> , smpp_time . parse_t ( '<STR_LIT>' ) ) <EOL> self . assertEquals ( '<STR_LIT>' , smpp_time . unparse_t ( <NUM_LIT:9> ) ) <EOL> self . assertRaises ( ValueError , smpp_time . parse_t , '<STR_LIT:a>' ) <EOL> self . assertRaises ( ValueError , smpp_time . parse_t , '<STR_LIT>' ) <EOL> def test_parse_nn ( self ) : <EOL> self . assertEquals ( <NUM_LIT:0> , smpp_time . parse_nn ( '<STR_LIT>' ) ) <EOL> self . assertEquals ( '<STR_LIT>' , smpp_time . unparse_nn ( <NUM_LIT:0> ) ) <EOL> self . assertEquals ( <NUM_LIT> , smpp_time . parse_nn ( '<STR_LIT>' ) ) <EOL> self . assertEquals ( '<STR_LIT>' , smpp_time . unparse_nn ( <NUM_LIT> ) ) <EOL> self . assertRaises ( ValueError , smpp_time . parse_nn , '<STR_LIT>' ) <EOL> self . assertRaises ( ValueError , smpp_time . parse_nn , '<STR_LIT:0>' ) <EOL> def test_parse_relative ( self ) : <EOL> str = '<STR_LIT>' <EOL> rel = smpp_time . parse ( str ) <EOL> self . assertEquals ( smpp_time . SMPPRelativeTime , rel . __class__ ) <EOL> self . assertEquals ( <NUM_LIT:2> , rel . years ) <EOL> self . assertEquals ( <NUM_LIT:6> , rel . months ) <EOL> self . assertEquals ( <NUM_LIT:10> , rel . days ) <EOL> self . assertEquals ( <NUM_LIT> , rel . hours ) <EOL> self . assertEquals ( <NUM_LIT> , rel . minutes ) <EOL> self . assertEquals ( <NUM_LIT> , rel . seconds ) <EOL> self . assertEquals ( str , smpp_time . unparse ( rel ) ) <EOL> def test_parse_relative_mins_only ( self ) : <EOL> str = '<STR_LIT>' <EOL> rel = smpp_time . parse ( str ) <EOL> self . assertEquals ( smpp_time . SMPPRelativeTime , rel . __class__ ) <EOL> self . assertEquals ( <NUM_LIT:0> , rel . years ) <EOL> self . assertEquals ( <NUM_LIT:0> , rel . months ) <EOL> self . assertEquals ( <NUM_LIT:0> , rel . days ) <EOL> self . assertEquals ( <NUM_LIT:0> , rel . hours ) <EOL> self . assertEquals ( <NUM_LIT:10> , rel . minutes ) <EOL> self . assertEquals ( <NUM_LIT:0> , rel . seconds ) <EOL> self . assertEquals ( str , smpp_time . unparse ( rel ) ) <EOL> def test_parse_absolute_no_offset ( self ) : <EOL> str = '<STR_LIT>' <EOL> dt = smpp_time . parse ( str ) <EOL> self . assertEquals ( <NUM_LIT> , dt . year ) <EOL> self . assertEquals ( <NUM_LIT:9> , dt . month ) <EOL> self . assertEquals ( <NUM_LIT> , dt . day ) <EOL> self . assertEquals ( <NUM_LIT> , dt . hour ) <EOL> self . assertEquals ( <NUM_LIT> , dt . minute ) <EOL> self . assertEquals ( <NUM_LIT> , dt . second ) <EOL> self . assertEquals ( <NUM_LIT> , dt . microsecond ) <EOL> self . assertEquals ( None , dt . tzinfo ) <EOL> self . assertEquals ( str , smpp_time . unparse ( dt ) ) <EOL> def test_parse_absolute_positive_offset ( self ) : <EOL> str = '<STR_LIT>' <EOL> dt = smpp_time . parse ( str ) <EOL> self . assertEquals ( <NUM_LIT> , dt . year ) <EOL> self . assertEquals ( <NUM_LIT:9> , dt . month ) <EOL> self . assertEquals ( <NUM_LIT> , dt . day ) <EOL> self . assertEquals ( <NUM_LIT> , dt . hour ) <EOL> self . assertEquals ( <NUM_LIT> , dt . minute ) <EOL> self . assertEquals ( <NUM_LIT> , dt . second ) <EOL> self . assertEquals ( <NUM_LIT> , dt . microsecond ) <EOL> self . assertEquals ( timedelta ( hours = <NUM_LIT:12> ) , dt . tzinfo . utcoffset ( None ) ) <EOL> self . assertEquals ( str , smpp_time . unparse ( dt ) ) <EOL> def test_parse_absolute_negative_offset ( self ) : <EOL> str = '<STR_LIT>' <EOL> dt = smpp_time . parse ( str ) <EOL> self . assertEquals ( <NUM_LIT> , dt . year ) <EOL> self . assertEquals ( <NUM_LIT:9> , dt . month ) <EOL> self . assertEquals ( <NUM_LIT> , dt . day ) <EOL> self . assertEquals ( <NUM_LIT> , dt . hour ) <EOL> self . assertEquals ( <NUM_LIT> , dt . minute ) <EOL> self . assertEquals ( <NUM_LIT> , dt . second ) <EOL> self . assertEquals ( <NUM_LIT> , dt . microsecond ) <EOL> self . assertEquals ( timedelta ( hours = - <NUM_LIT:12> ) , dt . tzinfo . utcoffset ( None ) ) <EOL> self . assertEquals ( str , smpp_time . unparse ( dt ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
