From 81ccc9229793cb038474efe87c5916d034b9298d Mon Sep 17 00:00:00 2001 From: Patryk Czajka Date: Mon, 4 Mar 2024 15:43:25 +0100 Subject: [PATCH] remove snapshots for Windows run --- tests_integration/__snapshots__/test_git.ambr | 19 ------------------- tests_integration/test_git.py | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 23 deletions(-) delete mode 100644 tests_integration/__snapshots__/test_git.ambr diff --git a/tests_integration/__snapshots__/test_git.ambr b/tests_integration/__snapshots__/test_git.ambr deleted file mode 100644 index 2627b9b5cb..0000000000 --- a/tests_integration/__snapshots__/test_git.ambr +++ /dev/null @@ -1,19 +0,0 @@ -# serializer version: 1 -# name: test_copy - ''' - ╭─ Error ──────────────────────────────────────────────────────────────────────╮ - │ REPOSITORY_PATH should be a path to git repository stage with scope │ - │ provided. For example: @my_repo/branches/main │ - ╰──────────────────────────────────────────────────────────────────────────────╯ - - ''' -# --- -# name: test_list_files - ''' - ╭─ Error ──────────────────────────────────────────────────────────────────────╮ - │ REPOSITORY_PATH should be a path to git repository stage with scope │ - │ provided. For example: @my_repo/branches/main │ - ╰──────────────────────────────────────────────────────────────────────────────╯ - - ''' -# --- diff --git a/tests_integration/test_git.py b/tests_integration/test_git.py index 224a53c318..d1d30d2117 100644 --- a/tests_integration/test_git.py +++ b/tests_integration/test_git.py @@ -113,10 +113,10 @@ def test_list_branches_and_tags(runner, git_repository): @pytest.mark.integration -def test_list_files(runner, git_repository, snapshot): +def test_list_files(runner, git_repository): # error messages result = runner.invoke_with_connection(["git", "list-files", git_repository]) - assert result.output == snapshot + _assert_error_message_in_output(result.output) try: repository_path = f"@{git_repository}" @@ -170,7 +170,7 @@ def test_list_files(runner, git_repository, snapshot): @pytest.mark.integration -def test_copy(runner, git_repository, snapshot): +def test_copy(runner, git_repository): # create stage for testing copy STAGE_NAME = "a_perfect_stage_for_testing" result = runner.invoke_with_connection(["sql", "-q", f"create stage {STAGE_NAME}"]) @@ -180,7 +180,7 @@ def test_copy(runner, git_repository, snapshot): result = runner.invoke_with_connection( ["git", "copy", git_repository, f"@{STAGE_NAME}"] ) - assert result.output == snapshot + _assert_error_message_in_output(result.output) try: repository_path = f"@{git_repository}" runner.invoke_with_connection( @@ -254,6 +254,14 @@ def _filter_key(objects, *, key): return [o[key] for o in objects] +def _assert_error_message_in_output(output): + assert "Error" in output + assert ( + "REPOSITORY_PATH should be a path to git repository stage with scope" in output + ) + assert "provided. For example: @my_repo/branches/main" in output + + def _integration_exists(runner, integration_name): result = runner.invoke_with_connection_json(["sql", "-q", "SHOW INTEGRATIONS"]) assert result.exit_code == 0