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

Method _test_member

Lib/test/test_tarfile.py:1086–1101  ·  view source on GitHub ↗
(self, tarinfo, chksum=None, **kwargs)

Source from the content-addressed store, hash-verified

1084class MemberReadTest(ReadTest, unittest.TestCase):
1085
1086 def _test_member(self, tarinfo, chksum=None, **kwargs):
1087 if chksum is not None:
1088 with self.tar.extractfile(tarinfo) as f:
1089 self.assertEqual(sha256sum(f.read()), chksum,
1090 "wrong sha256sum for %s" % tarinfo.name)
1091
1092 kwargs["mtime"] = 0o7606136617
1093 kwargs["uid"] = 1000
1094 kwargs["gid"] = 100
1095 if "old-v7" not in tarinfo.name:
1096 # V7 tar can't handle alphabetic owners.
1097 kwargs["uname"] = "tarfile"
1098 kwargs["gname"] = "tarfile"
1099 for k, v in kwargs.items():
1100 self.assertEqual(getattr(tarinfo, k), v,
1101 "wrong value in %s field of %s" % (k, tarinfo.name))
1102
1103 def test_find_regtype(self):
1104 tarinfo = self.tar.getmember("ustar/regtype")

Callers 15

test_find_regtypeMethod · 0.95
test_find_conttypeMethod · 0.95
test_find_dirtypeMethod · 0.95
test_find_lnktypeMethod · 0.95
test_find_symtypeMethod · 0.95
test_find_blktypeMethod · 0.95
test_find_chrtypeMethod · 0.95
test_find_fifotypeMethod · 0.95
test_find_sparseMethod · 0.95
test_find_gnusparseMethod · 0.95

Calls 5

sha256sumFunction · 0.85
extractfileMethod · 0.80
assertEqualMethod · 0.45
readMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected