MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_double_write

Method test_double_write

Lib/test/test_csv.py:1093–1102  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1091 self.assertEqual(fileobj.read(), expected)
1092
1093 def test_double_write(self):
1094 import array
1095 contents = [(20-i)*0.1 for i in range(20)]
1096 a = array.array('d', contents)
1097 with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj:
1098 writer = csv.writer(fileobj, dialect="excel")
1099 writer.writerow(a)
1100 expected = ",".join([str(i) for i in a])+"\r\n"
1101 fileobj.seek(0)
1102 self.assertEqual(fileobj.read(), expected)
1103
1104 def test_float_write(self):
1105 import array

Callers

nothing calls this directly

Calls 8

TemporaryFileFunction · 0.90
strFunction · 0.85
writerMethod · 0.45
writerowMethod · 0.45
joinMethod · 0.45
seekMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected