Unverified Commit 83d6cc26 authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

aggressive logging for debugging purpose



Signed-off-by: Sebastian Schüpbach's avatarSebastian Schüpbach <sebastian.schuepbach@unibas.ch>
parent 9007ffef
Pipeline #16879 failed with stages
in 58 seconds
......@@ -164,6 +164,13 @@ def _is_directly_fetchable(digital_object_resource):
def _get_access_status(graph, record_id):
for resource in graph:
logging.info(resource)
logging.info("type in resource => {}".format('type' in resource))
logging.info("type == 'access' => {}".format(resource['type'] == 'access'))
logging.info("regulates in resource => {}".format('regulates' in resource))
logging.info("resource['regulates'].startswith('https://memobase.ch/digital/') => {}".format(
resource['regulates'].startswith('https://memobase.ch/digital/')))
logging.info("'name' in resource => {}".format('name' in resource))
if 'type' in resource and resource['type'] == 'access' and \
'regulates' in resource and \
resource['regulates'].startswith('https://memobase.ch/digital/') and \
......
......@@ -62,6 +62,15 @@ class Test(TestCase):
Test._load_file_and_get_res('mfk-FLM-167202.json', lambda x: x), 'some_rec')
self.assertEqual(access_status, 'public')
def test__get_access_status(self):
path = Path(__file__).parent / f"../fixtures/value.json"
with path.open('r') as f:
json_msg = json.load(f)
records_json_data = json_msg['@graph']
access_status = MediametadataToDB._get_access_status(
records_json_data, 'some_rec')
access_status
def test__get_values_from_inaccessible_digital_object(self):
res = {
'sig': 'BAB-PA_43-BAB_MC169A-1',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment