Пример #1
0
 def test_entity_is_validated__success(self, private_key):
     entity = Share(
         actor_id="https://localhost.local/foo",
         id="https://localhost.local/bar",
         created_at=datetime.now(),
         target_id="https://localhost.local/bar",
     )
     get_outbound_entity(entity, private_key)
Пример #2
0
 def test_entity_is_validated__fail(self, private_key):
     entity = Share(
         actor_id="https://localhost.local/foo",
         id="https://localhost.local/bar",
         created_at=datetime.now(),
     )
     with pytest.raises(ValueError):
         get_outbound_entity(entity, private_key)
Пример #3
0
 def test_entity_is_validated__fail(self, private_key):
     entity = Share(
         actor_id="*****@*****.**",
         handle="*****@*****.**",
         id="1" * 16,
         guid="1" * 16,
         created_at=datetime.now(),
         target_id="2" * 16,
     )
     with pytest.raises(ValueError):
         get_outbound_entity(entity, private_key)
Пример #4
0
 def test_entity_is_validated__success(self, private_key):
     entity = Share(
         actor_id="*****@*****.**",
         handle="*****@*****.**",
         id="1" * 16,
         guid="1" * 16,
         created_at=datetime.now(),
         target_handle="*****@*****.**",
         target_id="2" * 16,
         target_guid="2" * 16,
     )
     get_outbound_entity(entity, private_key)
Пример #5
0
 def test_share_is_converted_to_diasporareshare(self, private_key):
     entity = Share()
     assert isinstance(get_outbound_entity(entity, private_key),
                       DiasporaReshare)