Skip to content

Commit 1668fab

Browse files
committed
Make export MIME type assertions robust to system differences
Accept multiple possible MIME types for gzip and zstd formats to accommodate variations across different distributions. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
1 parent bd7b920 commit 1668fab

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/misc/test_export.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ def export_test(host: Host, vm: VM, filepath: str, compress: Literal['none', 'gz
1919
defer(lambda: host.ssh(f'rm -f {filepath}', check=False))
2020
assert host.file_exists(filepath)
2121

22-
def check_file_type(expected: str) -> None:
23-
assert host.ssh(f'file --mime-type -b {filepath}') == expected
22+
def check_file_type(expected: list[str]) -> None:
23+
assert host.ssh(f'file --mime-type -b {filepath}') in expected
2424

2525
if compress == 'none':
26-
check_file_type('application/x-tar')
26+
check_file_type(['application/x-tar'])
2727
elif compress == 'gzip':
28-
check_file_type('application/x-gzip')
28+
check_file_type(['application/x-gzip', 'application/gzip'])
2929
elif compress == 'zstd':
30-
check_file_type('application/octet-stream')
30+
check_file_type(['application/octet-stream', 'application/zstd'])
3131
else:
3232
assert False, 'Unsupported compress mode'
3333

0 commit comments

Comments
 (0)