Esempio n. 1
0
 def test_sign(self):
     ns = Namespace('banana')
     x = ns.sign('split')
     assert x.startswith('split'), x
     assert ns.sign(None) is None
     assert x.endswith(ns.signature('split'))
     assert ns.signature(None) is None
Esempio n. 2
0
 def test_sign(self):
     ns = Namespace("banana")
     x = ns.sign("split")
     assert x.startswith("split"), x
     assert ns.sign(None) is None
     assert x.endswith(ns.signature("split"))
     assert ns.signature(None) is None
Esempio n. 3
0
 def test_verify(self):
     ns = Namespace('banana')
     x = ns.sign('split')
     assert Namespace.SEP in x
     assert ns.verify(x)
     assert not ns.verify('split')
     assert not ns.verify(None)
Esempio n. 4
0
 def test_verify(self):
     ns = Namespace("banana")
     x = ns.sign("split")
     assert Namespace.SEP in x
     assert ns.verify(x)
     assert not ns.verify("split")
     assert not ns.verify(None)
Esempio n. 5
0
 def test_apply(self):
     entity = {
         "id": "banana",
         "schema": "LegalEntity",
         "properties": {"sameAs": ["kumkwat"], "parent": ["pretzel"]},
     }
     proxy = model.get_proxy(entity)
     assert proxy.id == "banana", proxy.id
     ns = Namespace("fruit")
     out = ns.apply(proxy)
     assert out.id == ns.sign(proxy.id), out
Esempio n. 6
0
 def test_apply(self):
     entity = {
         'id': 'banana',
         'schema': 'LegalEntity',
         'properties': {
             'sameAs': ['kumkwat'],
             'parent': ['pretzel']
         }
     }
     proxy = model.get_proxy(entity)
     assert proxy.id == 'banana', proxy.id
     ns = Namespace('fruit')
     out = ns.apply(proxy)
     assert out.id == ns.sign(proxy.id), out
Esempio n. 7
0
 def test_sign_null(self):
     null = Namespace(None)
     assert null.sign('split') == 'split', null.sign('split')
     assert null.signature('split') is None
Esempio n. 8
0
 def test_sign_null(self):
     null = Namespace(None)
     assert null.sign("split") == "split", null.sign("split")
     assert null.signature("split") is None