diff --git a/caom2/caom2/common.py b/caom2/caom2/common.py index dd941af7..4f65673b 100644 --- a/caom2/caom2/common.py +++ b/caom2/caom2/common.py @@ -76,11 +76,14 @@ from builtins import int, str from six.moves.urllib.parse import SplitResult, urlparse +import logging from . import caom_util __all__ = ['CaomObject', 'AbstractCaomEntity', 'ObservationURI', 'ChecksumURI'] +logger = logging.getLogger('caom2') + def get_current_ivoa_time(): """Generate a datetime with 3 digit microsecond precision. @@ -341,14 +344,15 @@ def __init__(self, uri): # note: urlparse does not recognize scheme in uri of form scheme:val tmp = uri.split(':', 1) + # TODO change this raise a ValueError when the rule is being enforced if len(tmp) < 2: - raise ValueError( - ("A checksum scheme noting the algorithm is " - "required.. received: {}") - .format(uri)) - - algorithm = tmp[0] - checksum = tmp[1] + logger.warn(("A checksum scheme noting the algorithm is " + "required.. received: {}").format(uri)) + algorithm = None + checksum = tmp[0] + else: + algorithm = tmp[0] + checksum = tmp[1] if checksum is None: raise ValueError( diff --git a/caom2/caom2/tests/test_artifact.py b/caom2/caom2/tests/test_artifact.py index 345f9ec4..c113f7fd 100644 --- a/caom2/caom2/tests/test_artifact.py +++ b/caom2/caom2/tests/test_artifact.py @@ -181,5 +181,7 @@ def test_all(self): artifact.ReleaseType('META'), artifact.ProductType('THUMBNAIL')) - with self.assertRaises(ValueError): - test_artifact.content_checksum = common.ChecksumURI('0x1234') + # TODO re-enable when check enforced + # with self.assertRaises(ValueError): + test_artifact.content_checksum = common.ChecksumURI('0x1234') + assert test_artifact.content_checksum.uri == '0x1234'