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

Method test_tofromlist

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

Source from the content-addressed store, hash-verified

520 os_helper.unlink(os_helper.TESTFN)
521
522 def test_tofromlist(self):
523 a = array.array(self.typecode, 2*self.example)
524 b = array.array(self.typecode)
525 self.assertRaises(TypeError, a.tolist, 42)
526 self.assertRaises(TypeError, b.fromlist)
527 self.assertRaises(TypeError, b.fromlist, 42)
528 self.assertRaises(TypeError, b.fromlist, [None])
529 b.fromlist(a.tolist())
530 self.assertEqual(a, b)
531
532 def test_tofrombytes(self):
533 a = array.array(self.typecode, 2*self.example)

Callers 1

test_tofromlistMethod · 0.45

Calls 4

assertRaisesMethod · 0.95
fromlistMethod · 0.80
tolistMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected