(self)
| 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) |
nothing calls this directly
no test coverage detected