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

Method test_from_csv

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

Source from the content-addressed store, hash-verified

409 assert data.to_csv().endswith("2,Sam,US\r\n3,Jess,US\r\n4,Frank,UK\r\n5,Demo,CA\r\n")
410
411 def test_from_csv(self):
412 bl = BoxList.from_csv(filename=Path(test_root, "data", "csv_file.csv"))
413 assert bl[1].Name == "Sam"
414 b2 = BoxList.from_csv(
415 "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"
416 )
417 assert b2[2].Name == "Jess"
418
419 def test_from_csv_kwargs(self):
420 text = "Number;Name\r\n1;Chris\r\n2;Sam\r\n"

Callers

nothing calls this directly

Calls 1

from_csvMethod · 0.80

Tested by

no test coverage detected