-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
workspaceId should be part of spec request (#12112)
* workspaceId should be part of spec request * address review comment * fix test * format * update octavia according to API changes * create integration test for definition generation * fix test * fix test Co-authored-by: alafanechere <augustin.lafanechere@gmail.com>
- Loading branch information
1 parent
e846743
commit 405bf4d
Showing
15 changed files
with
122 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
octavia-cli/integration_tests/test_generate/test_definitions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# | ||
# Copyright (c) 2021 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
import os | ||
|
||
import pytest | ||
import yaml | ||
from octavia_cli.generate.commands import generate_source_or_destination | ||
|
||
pytestmark = pytest.mark.integration | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("definition_type, definition_id, resource_name"), | ||
[ | ||
("source", "6371b14b-bc68-4236-bfbd-468e8df8e968", "test_generate_source"), | ||
("destination", "22f6c74f-5699-40ff-833c-4a879ea40133", "test_generate_destination"), | ||
], | ||
) | ||
def test_generate_source_or_destination( | ||
octavia_tmp_project_directory, api_client, workspace_id, definition_type, definition_id, resource_name | ||
): | ||
current_path = os.getcwd() | ||
os.chdir(octavia_tmp_project_directory) | ||
generate_source_or_destination(definition_type, api_client, workspace_id, definition_id, resource_name) | ||
expected_output_path = f"{definition_type}s/{resource_name}/configuration.yaml" | ||
with open(expected_output_path, "r") as f: | ||
parsed_yaml = yaml.safe_load(f) | ||
assert parsed_yaml["resource_name"] == resource_name | ||
assert parsed_yaml["definition_type"] == definition_type | ||
assert parsed_yaml["definition_id"] == definition_id | ||
os.chdir(current_path) |
Oops, something went wrong.