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

Method test_int_write

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

Source from the content-addressed store, hash-verified

1079
1080class TestArrayWrites(unittest.TestCase):
1081 def test_int_write(self):
1082 import array
1083 contents = [(20-i) for i in range(20)]
1084 a = array.array('i', contents)
1085
1086 with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj:
1087 writer = csv.writer(fileobj, dialect="excel")
1088 writer.writerow(a)
1089 expected = ",".join([str(i) for i in a])+"\r\n"
1090 fileobj.seek(0)
1091 self.assertEqual(fileobj.read(), expected)
1092
1093 def test_double_write(self):
1094 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