aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2016-05-19 16:42:10 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2016-05-19 16:42:10 +0300
commitf577f65bf94a730459fb5a1b224842ed4f14683d (patch)
treeb6af5c2c4d15a2c3d9a60f236734c43155fb718c
parent385617f31ae1aaa3f27e0541bdff641404f95ee1 (diff)
downloadlinaro-image-tools-f577f65bf94a730459fb5a1b224842ed4f14683d.tar.gz
testing: add sha256 property
Change-Id: I4547a809618fef196e8cec8eea461b1706bf9e55 Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
-rw-r--r--linaro_image_tools/hwpack/testing.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/linaro_image_tools/hwpack/testing.py b/linaro_image_tools/hwpack/testing.py
index 9d6a17d..cc9bc93 100644
--- a/linaro_image_tools/hwpack/testing.py
+++ b/linaro_image_tools/hwpack/testing.py
@@ -126,6 +126,12 @@ class DummyFetchedPackage(FetchedPackage):
md5sum.update(self.content.read())
return md5sum.hexdigest()
+ @property
+ def sha256(self):
+ sha256sum = hashlib.sha256()
+ sha256sum.update(self.content.read())
+ return sha256sum.hexdigest()
+
class AptSourceFixture(object):
"""A fixture that provides an apt source, with packages and indices.