@@ -149,23 +149,23 @@ class p_buffer(buffer_test, unittest.TestCase):
149149 e3 .Parse (b'statement_id' , b'query' , (123 ,)),
150150 e3 .Parse (b'statement_id' , b'query' , ()),
151151 e3 .Bind (b'portal_id' , b'statement_id' ,
152- [ b'tt' ,b'\x00 \x00 ' ] ,
152+ ( b'tt' ,b'\x00 \x00 ' ) ,
153153 [b'data' ,None ], (b'ff' ,b'xx' )),
154- e3 .Bind (b'portal_id' , b'statement_id' , [ b'tt' ] , [None ], (b'xx' ,)),
155- e3 .Bind (b'portal_id' , b'statement_id' , [ b'ff' ] , [b'data' ], ()),
156- e3 .Bind (b'portal_id' , b'statement_id' , [] , [], (b'xx' ,)),
157- e3 .Bind (b'portal_id' , b'statement_id' , [] , [], ()),
154+ e3 .Bind (b'portal_id' , b'statement_id' , ( b'tt' ,) , [None ], (b'xx' ,)),
155+ e3 .Bind (b'portal_id' , b'statement_id' , ( b'ff' ,) , [b'data' ], ()),
156+ e3 .Bind (b'portal_id' , b'statement_id' , () , [], (b'xx' ,)),
157+ e3 .Bind (b'portal_id' , b'statement_id' , () , [], ()),
158158 e3 .Execute (b'portal_id' , 500 ),
159159 e3 .Execute (b'portal_id' , 0 ),
160160 e3 .DescribeStatement (b'statement_id' ),
161161 e3 .DescribePortal (b'portal_id' ),
162162 e3 .CloseStatement (b'statement_id' ),
163163 e3 .ClosePortal (b'portal_id' ),
164- e3 .Function (123 , [] , [], b'xx' ),
165- e3 .Function (321 , [ b'tt' ] , [b'foo' ], b'xx' ),
166- e3 .Function (321 , [ b'tt' ] , [None ], b'xx' ),
167- e3 .Function (321 , [ b'aa' , b'aa' ] , [None ,b'a' * 200 ], b'xx' ),
168- e3 .FunctionResult ('' ),
164+ e3 .Function (123 , () , [], b'xx' ),
165+ e3 .Function (321 , ( b'tt' ,) , [b'foo' ], b'xx' ),
166+ e3 .Function (321 , ( b'tt' ,) , [None ], b'xx' ),
167+ e3 .Function (321 , ( b'aa' , b'aa' ) , [None ,b'a' * 200 ], b'xx' ),
168+ e3 .FunctionResult (b '' ),
169169 e3 .FunctionResult (b'foobar' ),
170170 e3 .FunctionResult (None ),
171171 e3 .CopyToBegin (123 , [321 ,123 ]),
@@ -185,9 +185,7 @@ class test_element3(unittest.TestCase):
185185 def testSerializeParseConsistency (self ):
186186 for msg in message_samples :
187187 smsg = msg .serialize ()
188- self .failUnlessEqual (
189- msg , msg .parse (smsg ),
190- )
188+ self .failUnlessEqual (msg , msg .parse (smsg ))
191189
192190 def testEmptyMessages (self ):
193191 for x in e3 .__dict__ .values ():
@@ -335,7 +333,7 @@ def testTransactionSamplesAll(self):
335333 x .state [1 ]()
336334 self .failUnlessEqual (x .messages , ())
337335 x .state [1 ](r )
338- self .failUnlessEqual (x .state [ 0 ] , c3 .Complete )
336+ self .failUnlessEqual (x .state , c3 .Complete )
339337 rec = []
340338 for y in x .completed :
341339 for z in y [1 ]:
@@ -552,7 +550,7 @@ def testTransactionSamplesAll(self):
552550 (0xffffffff , 0xffff ),
553551 (0 , 0xffff ),
554552 (0xffffffff , 0 ),
555- (0xffffffff / 2 , 0xffff / 2 ),
553+ (0xffffffff // 2 , 0xffff / / 2 ),
556554 ],
557555
558556 pg_types .CIDROID : [
@@ -597,7 +595,7 @@ def testTransactionSamplesAll(self):
597595consistency_samples [pg_types .OIDOID ] = \
598596 consistency_samples [pg_types .CIDOID ] = \
599597 consistency_samples [pg_types .XIDOID ] = [
600- 0 , 0xffffffff , 0xffffffff / 2 , 123 , 321 , 1 , 2 , 3
598+ 0 , 0xffffffff , 0xffffffff // 2 , 123 , 321 , 1 , 2 , 3
601599]
602600
603601consistency_samples [pg_types .LSEGOID ] = \
@@ -654,12 +652,12 @@ def testExpectIO(self, map, samples):
654652class test_typio (unittest .TestCase ):
655653 def testExpectations (self ):
656654 'IO tests where the pre-made expected serialized form is compared'
657- testExpectIO (self , pg_typio .oid_to_io , expectation_samples )
655+ testExpectIO (self , pg_typstruct .oid_to_io , expectation_samples )
658656
659657 def testConsistency (self ):
660658 'IO tests where the unpacked source is compared to re-unpacked result'
661659 for oid , sample in consistency_samples .items ():
662- pack , unpack = pg_typio .oid_to_io .get (oid , (None , None ))
660+ pack , unpack = pg_typstruct .oid_to_io .get (oid , (None , None ))
663661 if pack is not None :
664662 for x in sample :
665663 packed = pack (x )
@@ -671,7 +669,7 @@ def testConsistency(self):
671669 x , packed , unpacked
672670 )
673671 )
674- for oid , (pack , unpack ) in pg_typio .time_io .items ():
672+ for oid , (pack , unpack ) in pg_typstruct .time_io .items ():
675673 sample = consistency_samples .get (oid , [])
676674 for x in sample :
677675 packed = pack (x )
@@ -684,7 +682,7 @@ def testConsistency(self):
684682 )
685683 )
686684
687- for oid , (pack , unpack ) in pg_typio .time64_io .items ():
685+ for oid , (pack , unpack ) in pg_typstruct .time64_io .items ():
688686 sample = consistency_samples .get (oid , [])
689687 for x in sample :
690688 packed = pack (x )
0 commit comments