<s> import unittest <EOL> import skype4pytest <EOL> from Skype4Py . sms import * <EOL> class SmsMessageTest ( skype4pytest . TestCase ) : <EOL> def setUpObject ( self ) : <EOL> self . obj = SmsMessage ( self . skype , '<STR_LIT>' ) <EOL> def testDelete ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' ) <EOL> self . obj . Delete ( ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testMarkAsSeen ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> self . obj . MarkAsSeen ( ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testSend ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' ) <EOL> self . obj . Send ( ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testBody ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . Body <EOL> self . assertInstance ( t , unicode ) <EOL> self . assertEqual ( t , '<STR_LIT>' ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> self . obj . Body = '<STR_LIT>' <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testChunks ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . Chunks <EOL> self . assertInstance ( t , SmsChunkCollection ) <EOL> self . assertEqual ( len ( t ) , <NUM_LIT:2> ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testDatetime ( self ) : <EOL> from datetime import datetime <EOL> from time import time <EOL> now = time ( ) <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' % now ) <EOL> t = self . obj . Datetime <EOL> self . assertInstance ( t , datetime ) <EOL> self . assertEqual ( t , datetime . fromtimestamp ( now ) ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testFailureReason ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . FailureReason <EOL> self . assertInstance ( t , str ) <EOL> self . assertEqual ( t , '<STR_LIT>' ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testId ( self ) : <EOL> t = self . obj . Id <EOL> self . assertInstance ( t , int ) <EOL> self . assertEqual ( t , <NUM_LIT> ) <EOL> def testIsFailedUnseen ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . IsFailedUnseen <EOL> self . assertInstance ( t , bool ) <EOL> self . assertEqual ( t , True ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testPrice ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . Price <EOL> self . assertInstance ( t , int ) <EOL> self . assertEqual ( t , <NUM_LIT> ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testPriceCurrency ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . PriceCurrency <EOL> self . assertInstance ( t , unicode ) <EOL> self . assertEqual ( t , '<STR_LIT>' ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testPricePrecision ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . PricePrecision <EOL> self . assertInstance ( t , int ) <EOL> self . assertEqual ( t , <NUM_LIT:3> ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testPriceToText ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . PriceToText <EOL> self . assertInstance ( t , unicode ) <EOL> self . assertEqual ( t , '<STR_LIT>' ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testPriceValue ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . PriceValue <EOL> self . assertInstance ( t , float ) <EOL> self . assertEqual ( t , <NUM_LIT> ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testReplyToNumber ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . ReplyToNumber <EOL> self . assertInstance ( t , str ) <EOL> self . assertEqual ( t , '<STR_LIT>' ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> self . obj . ReplyToNumber = '<STR_LIT>' <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testSeen ( self ) : <EOL> from warnings import simplefilter <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> simplefilter ( '<STR_LIT:ignore>' ) <EOL> try : <EOL> self . obj . Seen = True <EOL> finally : <EOL> simplefilter ( '<STR_LIT:default>' ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testStatus ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . Status <EOL> self . assertInstance ( t , str ) <EOL> self . assertEqual ( t , '<STR_LIT>' ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testTargetNumbers ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . TargetNumbers <EOL> self . assertInstance ( t , tuple ) <EOL> self . assertEqual ( len ( t ) , <NUM_LIT:2> ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> self . obj . TargetNumbers = ( '<STR_LIT>' , ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testTargets ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . Targets <EOL> self . assertInstance ( t , SmsTargetCollection ) <EOL> self . assertEqual ( len ( t ) , <NUM_LIT:2> ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testTimestamp ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . Timestamp <EOL> self . assertInstance ( t , float ) <EOL> self . assertEqual ( t , <NUM_LIT> ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testType ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . Type <EOL> self . assertInstance ( t , str ) <EOL> self . assertEqual ( t , '<STR_LIT>' ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> class SmsChunkTest ( skype4pytest . TestCase ) : <EOL> def setUpObject ( self ) : <EOL> self . obj = SmsChunk ( SmsMessage ( self . skype , '<STR_LIT>' ) , <NUM_LIT:1> ) <EOL> def testCharactersLeft ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . CharactersLeft <EOL> self . assertInstance ( t , int ) <EOL> self . assertEqual ( t , <NUM_LIT:30> ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def testId ( self ) : <EOL> t = self . obj . Id <EOL> self . assertInstance ( t , int ) <EOL> self . assertEqual ( t , <NUM_LIT:1> ) <EOL> def testMessage ( self ) : <EOL> t = self . obj . Message <EOL> self . assertInstance ( t , SmsMessage ) <EOL> self . assertEqual ( t . Id , <NUM_LIT> ) <EOL> def testText ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . Text <EOL> self . assertInstance ( t , unicode ) <EOL> self . assertEqual ( t , '<STR_LIT>' ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> class SmsTargetTest ( skype4pytest . TestCase ) : <EOL> def setUpObject ( self ) : <EOL> self . obj = SmsTarget ( SmsMessage ( self . skype , '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> def testMessage ( self ) : <EOL> t = self . obj . Message <EOL> self . assertInstance ( t , SmsMessage ) <EOL> self . assertEqual ( t . Id , <NUM_LIT> ) <EOL> def testNumber ( self ) : <EOL> t = self . obj . Number <EOL> self . assertInstance ( t , str ) <EOL> self . assertEqual ( t , '<STR_LIT>' ) <EOL> def testStatus ( self ) : <EOL> self . api . enqueue ( '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> t = self . obj . Status <EOL> self . assertInstance ( t , str ) <EOL> self . assertEqual ( t , '<STR_LIT>' ) <EOL> self . failUnless ( self . api . is_empty ( ) ) <EOL> def suite ( ) : <EOL> return unittest . TestSuite ( [ <EOL> unittest . defaultTestLoader . loadTestsFromTestCase ( SmsMessageTest ) , <EOL> unittest . defaultTestLoader . loadTestsFromTestCase ( SmsChunkTest ) , <EOL> unittest . defaultTestLoader . loadTestsFromTestCase ( SmsTargetTest ) , <EOL> ] ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
