Coverage for appr/models/blob_base.py: 54%

# Coverage for appr/models/blob_base.py : 54%

## 24 statements 13 run 11 missing 0 excluded

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | from __future__ import absolute_import, division, print_function import appr.pack as packager DEFAULT_MEDIA_TYPE = 'kpm' class BlobBase(object): def __init__(self, package_name, blob, b64_encoded=True): self.package = package_name self.packager = packager.ApprPackage(blob, b64_encoded) @classmethod def get(cls, package_name, digest): b64blob = cls._fetch_b64blob(package_name, digest) return cls(package_name, b64blob) def save(self, content_media_type): raise NotImplementedError @classmethod def delete(cls, package_name, digest): raise NotImplementedError @classmethod def _fetch_b64blob(cls, package_name, digest): raise NotImplementedError @property def b64blob(self): return self.packager.b64blob @property def blob(self): return self.packager.blob @property def digest(self): return self.packager.digest @property def size(self): return self.packager.size