Пример #1
0
 def test_from_jsonld_minimal(self, kg_client):
     data = {
         '@context':
         'https://nexus.humanbrainproject.org/v0/contexts/nexus/core/distribution/v0.1.0',
         'downloadURL': 'http://example.com/data2.dat',
     }
     obj = Distribution.from_jsonld(data)
     assert obj.size is None
     assert obj.content_type is None
     assert obj.digest is None
     assert obj.digest_method is None
     assert obj.location == 'http://example.com/data2.dat'
Пример #2
0
 def test_from_jsonld(self, kg_client):
     data = {
         '@context':
         'https://nexus.humanbrainproject.org/v0/contexts/nexus/core/distribution/v0.1.0',
         'contentSize': {
             'unit': 'byte',
             'value': 456
         },
         'digest': {
             'algorithm': 'sha1',
             'value': 'a1b2c3'
         },
         'downloadURL': 'http://example.com/data2.dat',
         'mediaType': 'application/bar',
         'originalFileName': 'data2.dat'
     }
     obj = Distribution.from_jsonld(data)
     assert obj.size == 456
     assert obj.content_type == "application/bar"
     assert obj.digest == 'a1b2c3'
     assert obj.digest_method == "sha1"
     assert obj.location == 'http://example.com/data2.dat'