MCPcopy Create free account
hub / github.com/EntilZha/PyFunctional / test_to_csv_compressed

Method test_to_csv_compressed

functional/test/test_streams.py:376–392  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

374 self.assertNotEqual(expect, result)
375
376 def test_to_csv_compressed(self):
377 tmp_path = "functional/test/data/tmp/output.txt"
378 elements = [[1, 2, 3], [4, 5, 6], ["a", "b", "c"]]
379 expect = [["1", "2", "3"], ["4", "5", "6"], ["a", "b", "c"]]
380 sequence = self.seq(elements)
381
382 sequence.to_csv(tmp_path, compression="gzip")
383 result = self.seq.csv(tmp_path).to_list()
384 self.assertEqual(expect, result)
385
386 sequence.to_csv(tmp_path, compression="lzma")
387 result = self.seq.csv(tmp_path).to_list()
388 self.assertEqual(expect, result)
389
390 sequence.to_csv(tmp_path, compression="bz2")
391 result = self.seq.csv(tmp_path).to_list()
392 self.assertEqual(expect, result)
393
394 def test_to_sqlite3_failure(self):
395 insert_sql = "INSERT INTO user (id, name) VALUES (?, ?)"

Callers

nothing calls this directly

Calls 3

to_csvMethod · 0.80
to_listMethod · 0.80
csvMethod · 0.80

Tested by

no test coverage detected