@@ -414,7 +414,8 @@ async def test_copy_to_table_basics(self):
414414 '*a4*|b4' ,
415415 '*a5*|b5' ,
416416 '*!**|*n-u-l-l*' ,
417- 'n-u-l-l|bb'
417+ 'n-u-l-l|bb' ,
418+ '_-_filtered_-_value_-_|never-here'
418419 ]).encode ('utf-8' )
419420 )
420421 f .seek (0 )
@@ -431,7 +432,7 @@ async def test_copy_to_table_basics(self):
431432 schema_name = 'public' , format = 'csv' ,
432433 delimiter = '|' , null = 'n-u-l-l' , header = True ,
433434 quote = '*' , escape = '!' , force_not_null = ('a' ,),
434- force_null = force_null )
435+ force_null = force_null , where = 'a <> \' _-_filtered_-_value_-_ \' ' )
435436
436437 self .assertEqual (res , 'COPY 7' )
437438
@@ -635,9 +636,10 @@ async def test_copy_records_to_table_1(self):
635636 ]
636637
637638 records .append (('a-100' , None , None ))
639+ records .append (('b-999' , None , None ))
638640
639641 res = await self .con .copy_records_to_table (
640- 'copytab' , records = records )
642+ 'copytab' , records = records , where = 'a <> \' b-999 \' ' )
641643
642644 self .assertEqual (res , 'COPY 101' )
643645
@@ -658,9 +660,12 @@ async def record_generator():
658660 yield ('a-{}' .format (i ), i , date + delta )
659661
660662 yield ('a-100' , None , None )
663+ yield ('b-999' , None , None )
661664
662665 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+ )
664669
665670 self .assertEqual (res , 'COPY 101' )
666671
0 commit comments