Skip to content

Commit d149a24

Browse files
committed
chore: expand inspect tests
1 parent 5e2c965 commit d149a24

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

tests/integration/test_cli_inspect.py

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,40 @@ def test_cli_inspect_v4_2_2_vs_v4_3_1(all_target_mode_tdf_files, temp_credential
8484

8585

8686
@pytest.mark.integration
87-
def test_cli_inspect_different_file_types(tdf_v4_3_1_files, temp_credentials_file):
87+
def test_cli_inspect_different_file_types_v4_2_2(tdf_v4_2_2_files, temp_credentials_file):
88+
"""
89+
Test CLI inspect with different file types.
90+
"""
91+
92+
file_types_to_test = [
93+
"text",
94+
"binary",
95+
"with_attributes",
96+
] # TODO: Consider adding "empty" file type as well
97+
98+
for file_type in file_types_to_test:
99+
tdf_path = tdf_v4_2_2_files[file_type]
100+
101+
# Inspect the TDF
102+
result = _run_cli_inspect(tdf_path, temp_credentials_file)
103+
104+
assert result is not None, f"Failed to inspect {file_type} TDF"
105+
assert "manifest" in result, f"{file_type} TDF inspection missing manifest"
106+
107+
# Check file-type specific expectations
108+
if file_type == "empty":
109+
# Empty files should still have valid manifests
110+
assert "encryptionInformation" in result["manifest"]
111+
elif file_type == "with_attributes":
112+
# Attributed files should have keyAccess information
113+
assert (
114+
"keyAccess" in result["manifest"]
115+
or "encryptionInformation" in result["manifest"]
116+
)
117+
118+
119+
@pytest.mark.integration
120+
def test_cli_inspect_different_file_types_v4_3_1(tdf_v4_3_1_files, temp_credentials_file):
88121
"""
89122
Test CLI inspect with different file types.
90123
"""
@@ -118,7 +151,7 @@ def test_cli_inspect_different_file_types(tdf_v4_3_1_files, temp_credentials_fil
118151

119152
def _run_cli_inspect(tdf_path: Path, creds_file: Path) -> dict | None:
120153
"""
121-
Helper function to run CLI inspect command and return parsed JSON result.
154+
Helper function to run Python CLI inspect command and return parsed JSON result.
122155
123156
This demonstrates how the CLI inspect functionality could be tested
124157
with the new fixtures.

0 commit comments

Comments
 (0)