MCPcopy Index your code
hub / github.com/python/cpython / test_no_name_attribute

Method test_no_name_attribute

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

Source from the content-addressed store, hash-verified

560 self.assertEqual(tar.name, os.path.abspath(fobj.name))
561
562 def test_no_name_attribute(self):
563 with open(self.tarname, "rb") as fobj:
564 data = fobj.read()
565 fobj = io.BytesIO(data)
566 self.assertRaises(AttributeError, getattr, fobj, "name")
567 tar = tarfile.open(fileobj=fobj, mode=self.mode)
568 self.assertIsNone(tar.name)
569
570 def test_empty_name_attribute(self):
571 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