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

Method test_compare_members

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

Source from the content-addressed store, hash-verified

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