<s> """<STR_LIT>""" <EOL> import unittest <EOL> import sys <EOL> if __name__ == '<STR_LIT:__main__>' and sys . version_info < ( <NUM_LIT:2> , <NUM_LIT:6> ) : <EOL> sys . stderr . write ( """<STR_LIT>""" ) <EOL> import io <EOL> import serial <EOL> if sys . version_info >= ( <NUM_LIT:3> , <NUM_LIT:0> ) : <EOL> def unicode ( x ) : <EOL> return x <EOL> PORT = <NUM_LIT:0> <EOL> class Test_SerialAndIO ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . s = serial . serial_for_url ( PORT , timeout = <NUM_LIT:1> ) <EOL> self . io = io . TextIOWrapper ( io . BufferedRWPair ( self . s , self . s ) ) <EOL> def tearDown ( self ) : <EOL> self . s . close ( ) <EOL> def test_hello_raw ( self ) : <EOL> self . io . write ( b"<STR_LIT>" . decode ( '<STR_LIT:utf-8>' ) ) <EOL> self . io . flush ( ) <EOL> hello = self . io . readline ( ) <EOL> self . assertEqual ( hello , b"<STR_LIT>" . decode ( '<STR_LIT:utf-8>' ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> import sys <EOL> sys . stdout . write ( __doc__ ) <EOL> if len ( sys . argv ) > <NUM_LIT:1> : <EOL> PORT = sys . argv [ <NUM_LIT:1> ] <EOL> sys . stdout . write ( "<STR_LIT>" % PORT ) <EOL> sys . argv [ <NUM_LIT:1> : ] = [ '<STR_LIT>' ] <EOL> unittest . main ( ) </s>
