@@ -414,7 +414,8 @@ async def test_copy_to_table_basics(self):
414
414
'*a4*|b4' ,
415
415
'*a5*|b5' ,
416
416
'*!**|*n-u-l-l*' ,
417
- 'n-u-l-l|bb'
417
+ 'n-u-l-l|bb' ,
418
+ '_-_filtered_-_value_-_|never-here'
418
419
]).encode ('utf-8' )
419
420
)
420
421
f .seek (0 )
@@ -431,7 +432,7 @@ async def test_copy_to_table_basics(self):
431
432
schema_name = 'public' , format = 'csv' ,
432
433
delimiter = '|' , null = 'n-u-l-l' , header = True ,
433
434
quote = '*' , escape = '!' , force_not_null = ('a' ,),
434
- force_null = force_null )
435
+ force_null = force_null , where = 'a <> \' _-_filtered_-_value_-_ \' ' )
435
436
436
437
self .assertEqual (res , 'COPY 7' )
437
438
@@ -635,9 +636,10 @@ async def test_copy_records_to_table_1(self):
635
636
]
636
637
637
638
records .append (('a-100' , None , None ))
639
+ records .append (('b-999' , None , None ))
638
640
639
641
res = await self .con .copy_records_to_table (
640
- 'copytab' , records = records )
642
+ 'copytab' , records = records , where = 'a <> \' b-999 \' ' )
641
643
642
644
self .assertEqual (res , 'COPY 101' )
643
645
@@ -658,9 +660,12 @@ async def record_generator():
658
660
yield ('a-{}' .format (i ), i , date + delta )
659
661
660
662
yield ('a-100' , None , None )
663
+ yield ('b-999' , None , None )
661
664
662
665
res = await self .con .copy_records_to_table (
663
- 'copytab_async' , records = record_generator ())
666
+ 'copytab_async' , records = record_generator (),
667
+ where = 'a <> \' b-999\' '
668
+ )
664
669
665
670
self .assertEqual (res , 'COPY 101' )
666
671
0 commit comments