MCPcopy
hub / github.com/pandas-dev/pandas / test_ambiguous_archive_tar

Function test_ambiguous_archive_tar

pandas/tests/io/test_compression.py:342–356  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

340
341
342def test_ambiguous_archive_tar(tmp_path):
343 csvAPath = tmp_path / "a.csv"
344 with open(csvAPath, "w", encoding="utf-8") as a:
345 a.write("foo,bar\n")
346 csvBPath = tmp_path / "b.csv"
347 with open(csvBPath, "w", encoding="utf-8") as b:
348 b.write("foo,bar\n")
349
350 tarpath = tmp_path / "archive.tar"
351 with tarfile.TarFile(tarpath, "w") as tar:
352 tar.add(csvAPath, "a.csv")
353 tar.add(csvBPath, "b.csv")
354
355 with pytest.raises(ValueError, match="Multiple files found in TAR archive"):
356 pd.read_csv(tarpath)
357
358
359def test_tar_gz_to_different_filename(temp_file):

Callers

nothing calls this directly

Calls 4

writeMethod · 0.45
addMethod · 0.45
raisesMethod · 0.45
read_csvMethod · 0.45

Tested by

no test coverage detected