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

Method test_compare_members

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

Source from the content-addressed store, hash-verified

943 self.assertRaises(tarfile.StreamError, f.read)
944
945 def test_compare_members(self):
946 tar1 = tarfile.open(tarname, encoding="iso8859-1")
947 try:
948 tar2 = self.tar
949
950 while True:
951 t1 = tar1.next()
952 t2 = tar2.next()
953 if t1 is None:
954 break
955 self.assertIsNotNone(t2, "stream.next() failed.")
956
957 if t2.islnk() or t2.issym():
958 with self.assertRaises(tarfile.StreamError):
959 tar2.extractfile(t2)
960 continue
961
962 v1 = tar1.extractfile(t1)
963 v2 = tar2.extractfile(t2)
964 if v1 is None:
965 continue
966 self.assertIsNotNone(v2, "stream.extractfile() failed")
967 self.assertEqual(v1.read(), v2.read(),
968 "stream extraction failed")
969 finally:
970 tar1.close()
971
972class GzipStreamReadTest(GzipTest, StreamReadTest):
973 pass

Callers

nothing calls this directly

Calls 10

assertIsNotNoneMethod · 0.80
islnkMethod · 0.80
issymMethod · 0.80
extractfileMethod · 0.80
openMethod · 0.45
nextMethod · 0.45
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected