Skip to content

Commit

Permalink
Combine the manifest test to existing test_manifest.py file
Browse files Browse the repository at this point in the history
  • Loading branch information
jiakai-li committed Dec 6, 2024
1 parent 9b086ed commit 751c24b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 42 deletions.
42 changes: 0 additions & 42 deletions tests/test_manifest.py

This file was deleted.

23 changes: 23 additions & 0 deletions tests/utils/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,3 +604,26 @@ def test_write_manifest_list(
assert entry.file_sequence_number == 0 if format_version == 1 else 3
assert entry.snapshot_id == 8744736658442914487
assert entry.status == ManifestEntryStatus.ADDED


@pytest.mark.parametrize(
"raw_file_format,expected_file_format",
[
("avro", FileFormat("AVRO")),
("AVRO", FileFormat("AVRO")),
("parquet", FileFormat("PARQUET")),
("PARQUET", FileFormat("PARQUET")),
("orc", FileFormat("ORC")),
("ORC", FileFormat("ORC")),
("NOT_EXISTS", None),
],
)
def test_file_format_case_insensitive(raw_file_format: str, expected_file_format: FileFormat) -> None:
if expected_file_format:
parsed_file_format = FileFormat(raw_file_format)
assert parsed_file_format == expected_file_format, (
f"File format {raw_file_format}: {parsed_file_format} != {expected_file_format}"
)
else:
with pytest.raises(ValueError):
_ = FileFormat(raw_file_format)

0 comments on commit 751c24b

Please sign in to comment.