In order to mitigate against the brute force attacks against Gitlab accounts, we are moving to all edu-ID Logins. We would like to remind you to link your account with your edu-id. Login will be possible only by edu-ID after November 30, 2021. Here you can find the instructions for linking your account.

If you don't have a SWITCH edu-ID, you can create one with this guide here

kind regards

This Server has been upgraded to GitLab release 14.2.6

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',
......
Markdown is supported
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