MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / testDownload

Method testDownload

tests/ReleaseAsset.py:128–140  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

126 )
127
128 def testDownload(self):
129 with tempfile.TemporaryDirectory() as path:
130 tmpf_path = path + "/asset"
131 self.asset.download_asset(tmpf_path)
132 with open(tmpf_path, "rb") as tmpf:
133 tmpf.seek(0)
134 hash = hashlib.sha256(tmpf.read())
135 size = tmpf.tell()
136
137 assert self.asset.digest
138 digest = self.asset.digest.split(":")[1]
139 self.assertEqual(hash.hexdigest(), digest)
140 self.assertEqual(size, self.asset.size)

Callers

nothing calls this directly

Calls 2

download_assetMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected