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

Method test_no_name_attribute

Lib/test/test_tarfile.py:564–570  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

562 self.assertEqual(tar.name, os.path.abspath(fobj.name))
563
564 def test_no_name_attribute(self):
565 with open(self.tarname, "rb") as fobj:
566 data = fobj.read()
567 fobj = io.BytesIO(data)
568 self.assertRaises(AttributeError, getattr, fobj, "name")
569 tar = tarfile.open(fileobj=fobj, mode=self.mode)
570 self.assertIsNone(tar.name)
571
572 def test_empty_name_attribute(self):
573 with open(self.tarname, "rb") as fobj:

Callers

nothing calls this directly

Calls 5

readMethod · 0.95
assertIsNoneMethod · 0.80
openFunction · 0.50
assertRaisesMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected