#NEWLINE# def test_non_powers_of_eight_intX( ) : #NEWLINE# #INDENT# intX_test = [ ( 'unsigned_10b' , b . intX ( 10 , False ) ) , ( 'unsigned_14b' , b . intX ( 14 , False ) ) , ( 'signed_20b' , b . intX ( 20 , True ) ) , ( 'signed_4b' , b . intX ( 4 , True ) ) ] #NEWLINE# in_bytes = bytearray ( [ 213 , 234 , 53 , 213 , 234 , 53 ] ) #NEWLINE# result = b . parse ( in_bytes , intX_test ) #NEWLINE# assert_equal ( intX_test . unsigned_10b , 855 ) #NEWLINE# assert_equal ( result . unsigned_14b , 10805 ) #NEWLINE# assert_equal ( result . signed_20b , ( - 172381 ) ) #NEWLINE# assert_equal ( result . signed_4b , 5 ) #NEWLINE# assert_equal ( b . write ( result , intX_test ) , in_bytes )