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

Method test_from_csv

test/test_box_list.py:384–390  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

382 assert data.to_csv().endswith("2,Sam,US\r\n3,Jess,US\r\n4,Frank,UK\r\n5,Demo,CA\r\n")
383
384 def test_from_csv(self):
385 bl = BoxList.from_csv(filename=Path(test_root, "data", "csv_file.csv"))
386 assert bl[1].Name == "Sam"
387 b2 = BoxList.from_csv(
388 "Number,Name,Country\r\n1,Chris,US\r\n2,Sam,US\r\n3,Jess,US\r\n4,Frank,UK\r\n5,Demo,CA\r\n"
389 )
390 assert b2[2].Name == "Jess"
391
392 def test_bad_csv(self):
393 data = BoxList([{"test": 1}, {"bad": 2, "data": 3}])

Callers

nothing calls this directly

Calls 1

from_csvMethod · 0.80

Tested by

no test coverage detected