@@ -588,6 +588,7 @@ def test_execute(
588
588
expected_stage ,
589
589
expected_files ,
590
590
os_agnostic_snapshot ,
591
+ caplog ,
591
592
):
592
593
mock_execute .return_value = mock_cursor (
593
594
[
@@ -602,20 +603,18 @@ def test_execute(
602
603
603
604
assert result .exit_code == 0 , result .output
604
605
create_call , copy_call , ls_call , * execute_calls = mock_execute .mock_calls
606
+ stage = "FOO.BAR.snowflake_cli_tmp_stage_123"
605
607
assert create_call == mock .call (
606
- "create temporary stage if not exists IDENTIFIER('FOO.BAR.snowflake_cli_tmp_stage_123')"
607
- )
608
- assert copy_call == mock .call (
609
- f"copy files into @FOO.BAR.snowflake_cli_tmp_stage_123/ from { expected_stage } /"
610
- )
611
- assert ls_call == mock .call (
612
- f"ls @FOO.BAR.snowflake_cli_tmp_stage_123" , cursor_class = DictCursor
608
+ f"create temporary stage if not exists IDENTIFIER('{ stage } ')"
613
609
)
610
+ assert copy_call == mock .call (f"copy files into @{ stage } / from { expected_stage } /" )
611
+ assert ls_call == mock .call (f"ls @{ stage } " , cursor_class = DictCursor )
614
612
assert execute_calls == [
615
- mock .call (f"execute immediate from @FOO.BAR.snowflake_cli_tmp_stage_123{ p } " )
616
- for p in expected_files
613
+ mock .call (f"execute immediate from @{ stage } { p } " ) for p in expected_files
617
614
]
618
615
assert result .output == os_agnostic_snapshot
616
+ for expected_file in expected_files :
617
+ assert f"Executing SQL file: @{ stage } { expected_file } " in caplog .messages
619
618
620
619
621
620
@pytest .mark .parametrize (
@@ -658,6 +657,7 @@ def test_execute_new_git_repository_list_files(
658
657
expected_stage ,
659
658
expected_files ,
660
659
os_agnostic_snapshot ,
660
+ caplog ,
661
661
):
662
662
mock_execute .return_value = mock_cursor (
663
663
[
@@ -672,20 +672,18 @@ def test_execute_new_git_repository_list_files(
672
672
673
673
assert result .exit_code == 0 , result .output
674
674
create_call , copy_call , ls_call , * execute_calls = mock_execute .mock_calls
675
+ stage = "FOO.BAR.snowflake_cli_tmp_stage_123"
675
676
assert create_call == mock .call (
676
- "create temporary stage if not exists IDENTIFIER('FOO.BAR.snowflake_cli_tmp_stage_123')"
677
- )
678
- assert copy_call == mock .call (
679
- f"copy files into @FOO.BAR.snowflake_cli_tmp_stage_123/ from { expected_stage } /"
680
- )
681
- assert ls_call == mock .call (
682
- f"ls @FOO.BAR.snowflake_cli_tmp_stage_123" , cursor_class = DictCursor
677
+ f"create temporary stage if not exists IDENTIFIER('{ stage } ')"
683
678
)
679
+ assert copy_call == mock .call (f"copy files into @{ stage } / from { expected_stage } /" )
680
+ assert ls_call == mock .call (f"ls @{ stage } " , cursor_class = DictCursor )
684
681
assert execute_calls == [
685
- mock .call (f"execute immediate from @FOO.BAR.snowflake_cli_tmp_stage_123{ p } " )
686
- for p in expected_files
682
+ mock .call (f"execute immediate from @{ stage } { p } " ) for p in expected_files
687
683
]
688
684
assert result .output == os_agnostic_snapshot
685
+ for expected_file in expected_files :
686
+ assert f"Executing SQL file: @{ stage } { expected_file } " in caplog .messages
689
687
690
688
691
689
@pytest .mark .parametrize (
0 commit comments