Skip to content

Commit ce80df0

Browse files
author
Jesse Whitehouse
committed
Basic e2e test scaffolded in. Currently fails.
Signed-off-by: Jesse Whitehouse <jesse.whitehouse@databricks.com>
1 parent a508a1c commit ce80df0

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

tests/e2e/driver_tests.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
705724
def main(cli_args):
706725
global get_args_from_env
707726
get_args_from_env = True

0 commit comments

Comments
 (0)