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

Method test_buffer_info

Lib/test/test_array.py:249–257  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

247 self.assertEqual(len(a), len(self.example))
248
249 def test_buffer_info(self):
250 a = array.array(self.typecode, self.example)
251 self.assertRaises(TypeError, a.buffer_info, 42)
252 bi = a.buffer_info()
253 self.assertIsInstance(bi, tuple)
254 self.assertEqual(len(bi), 2)
255 self.assertIsInstance(bi[0], int)
256 self.assertIsInstance(bi[1], int)
257 self.assertEqual(bi[1], len(a))
258
259 def test_byteswap(self):
260 if self.typecode in ('u', 'w'):

Callers 1

test_buffer_infoMethod · 0.45

Calls 5

assertRaisesMethod · 0.95
lenFunction · 0.85
buffer_infoMethod · 0.80
assertIsInstanceMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected