MCPcopy Create free account
hub / github.com/cdgriffith/Box / test_bad_file

Method test_bad_file

test/test_from_file.py:25–39  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

23 assert isinstance(box_from_file(Path(test_root, "data", "csv_file.csv")), BoxList)
24
25 def test_bad_file(self):
26 with pytest.raises(BoxError):
27 box_from_file(Path(test_root, "data", "bad_file.txt"), file_type="json")
28 with pytest.raises(BoxError):
29 box_from_file(Path(test_root, "data", "bad_file.txt"), file_type="toml")
30 with pytest.raises(BoxError):
31 box_from_file(Path(test_root, "data", "bad_file.txt"), file_type="yaml")
32 with pytest.raises(BoxError):
33 box_from_file(Path(test_root, "data", "bad_file.txt"), file_type="msgpack")
34 with pytest.raises(BoxError):
35 box_from_file(Path(test_root, "data", "bad_file.txt"), file_type="unknown")
36 with pytest.raises(BoxError):
37 box_from_file(Path(test_root, "data", "bad_file.txt"))
38 with pytest.raises(BoxError):
39 box_from_file("does not exist")
40
41 def test_from_string_all(self):
42 with open(Path(test_root, "data", "json_file.json"), "r") as f:

Callers

nothing calls this directly

Calls 1

box_from_fileFunction · 0.90

Tested by

no test coverage detected