File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -661,7 +661,7 @@ def test_staging_ingestion_life_cycle(self):
661661 with open (fh , "wb" ) as fp :
662662 fp .write (original_text )
663663
664- with self .connection () as conn :
664+ with self .connection (extra_params = { "uploads_base_path" : temp_path } ) as conn :
665665 cursor = conn .cursor ()
666666 query = f"PUT '{ temp_path } ' INTO 'stage://tmp/{ self .staging_ingestion_user } /tmp/11/15/file1.csv' OVERWRITE"
667667 cursor .execute (query )
@@ -702,6 +702,25 @@ def test_staging_ingestion_life_cycle(self):
702702 os .remove (new_temp_path )
703703
704704
705+ def test_staging_ingestion_put_fails_without_uploadsbasepath (self ):
706+ """PUT operations are not supported unless the connection was built with
707+ a parameter called uploads_base_path
708+ """
709+
710+ fh , temp_path = tempfile .mkstemp ()
711+
712+ original_text = "hello world!" .encode ("utf-8" )
713+
714+ with open (fh , "wb" ) as fp :
715+ fp .write (original_text )
716+
717+ with pytest .raises (Error ):
718+ with self .connection () as conn :
719+ cursor = conn .cursor ()
720+ query = f"PUT '{ temp_path } ' INTO 'stage://tmp/{ self .staging_ingestion_user } /tmp/11/15/file1.csv' OVERWRITE"
721+ cursor .execute (query )
722+
723+
705724def main (cli_args ):
706725 global get_args_from_env
707726 get_args_from_env = True
You can’t perform that action at this time.
0 commit comments