Skip to content

Commit 5304349

Browse files
author
Kolea Plesco
committed
Updated conceptual mappings diff tests
1 parent ae6ecb1 commit 5304349

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

ted_sws/mapping_suite_processor/entrypoints/cli/cmd_conceptual_mapping_differ.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ def run_cmd(self):
140140
else:
141141
error = Exception("Cannot do a diff with provided input!")
142142

143-
self._report(diff=diff, files=[filepath1, filepath2])
143+
if not error:
144+
self._report(diff=diff, files=[filepath1, filepath2])
145+
144146
self.run_cmd_result(error)
145147

146148

tests/e2e/mapping_suite_processor/conceptual_mapping_differ/test_cmd_conceptual_mapping_differ.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_cmd_conceptual_mapping_differ(caplog, cli_runner, fake_test_mapping_sui
4848
response = cli_runner.invoke(cli_main,
4949
["--opt-mappings-folder", temp_mapping_suite_path,
5050
"--opt-output-folder", temp_folder])
51+
5152
assert "FAILED" in response.output
5253
assert "Cannot do a diff" in response.output
5354

tests/e2e/mapping_suite_processor/conceptual_mapping_differ/test_conceptual_mapping_differ.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,37 @@ def test_mapping_suite_diff_conceptual_mappings():
1919

2020
mapping2.metadata = metadata1
2121

22-
assert not mapping_suite_diff_conceptual_mappings([mapping1, mapping2])
22+
assert not mapping_suite_diff_conceptual_mappings([mapping1, mapping2])['data']
2323

2424

2525
def test_mapping_suite_diff_file_conceptual_mappings(package_folder_path, package_F03_folder_path):
2626
""""""
2727
filepath1 = package_folder_path / MS_TRANSFORM_FOLDER_NAME / MS_CONCEPTUAL_MAPPING_FILE_NAME
2828
filepath2 = package_F03_folder_path / MS_TRANSFORM_FOLDER_NAME / MS_CONCEPTUAL_MAPPING_FILE_NAME
2929

30-
assert mapping_suite_diff_files_conceptual_mappings([filepath1, filepath2])
30+
diff = mapping_suite_diff_files_conceptual_mappings([filepath1, filepath2])
31+
assert diff['metadata']
32+
assert diff['data']
3133

3234

3335
def test_mapping_suite_diff_repo_conceptual_mappings(github_mapping_suite_id, package_folder_path):
3436
""""""
3537

36-
assert not mapping_suite_diff_repo_conceptual_mappings(
38+
diff = mapping_suite_diff_repo_conceptual_mappings(
3739
branch_or_tag_name=["main"],
3840
mapping_suite_id=[github_mapping_suite_id],
3941
)
42+
assert not diff['data']
4043

41-
assert mapping_suite_diff_repo_conceptual_mappings(
44+
diff = mapping_suite_diff_repo_conceptual_mappings(
4245
branch_or_tag_name=["main"],
4346
mapping_suite_id=[github_mapping_suite_id],
4447
filepath=package_folder_path / MS_TRANSFORM_FOLDER_NAME / MS_CONCEPTUAL_MAPPING_FILE_NAME
4548
)
49+
assert diff['data']
4650

47-
assert mapping_suite_diff_repo_conceptual_mappings(
51+
diff = mapping_suite_diff_repo_conceptual_mappings(
4852
branch_or_tag_name=["main"],
4953
mapping_suite_id=[github_mapping_suite_id, "package_F03_test"]
5054
)
55+
assert diff['data']

0 commit comments

Comments
 (0)