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

Method test_from_csv

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

Source from the content-addressed store, hash-verified

148 assert data.to_csv().endswith("2,Sam,US\r\n3,Jess,US\r\n4,Frank,UK\r\n5,Demo,CA\r\n")
149
150 def test_from_csv(self):
151 bl = BoxList.from_csv(filename=Path(test_root, "data", "csv_file.csv"))
152 assert bl[1].Name == "Sam"
153 b2 = BoxList.from_csv(
154 "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"
155 )
156 assert b2[2].Name == "Jess"
157
158 def test_bad_csv(self):
159 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