def test_required_validates(self):
     entity = Retraction(
         handle="fooexample.com", target_guid="x" * 16, entity_type="Post"
     )
     with pytest.raises(ValueError):
         entity.validate()
     entity = Retraction(
         handle="*****@*****.**", target_guid="x" * 15, entity_type="Post"
     )
     with pytest.raises(ValueError):
         entity.validate()
     entity = Retraction(
         handle="*****@*****.**", target_guid="x" * 16, entity_type="Foo"
     )
     with pytest.raises(ValueError):
         entity.validate()
 def test_retraction_is_converted_to_diasporaretraction(self, private_key):
     entity = Retraction()
     assert isinstance(get_outbound_entity(entity, private_key),
                       DiasporaRetraction)
Exemple #3
0
 def test_required_validates(self):
     entity = Retraction(
         handle="fooexample.com", target_guid="x" * 16, entity_type="Post"
     )
     with pytest.raises(ValueError):
         entity.validate()
     entity = Retraction(
         handle="*****@*****.**", target_guid="x" * 15, entity_type="Post"
     )
     with pytest.raises(ValueError):
         entity.validate()
     entity = Retraction(
         handle="*****@*****.**", target_guid="x" * 16, entity_type="Foo"
     )
     with pytest.raises(ValueError):
         entity.validate()
 def test_instance_creation(self):
     entity = Retraction(
         handle="*****@*****.**", target_guid="x"*16, entity_type="Post"
     )
     entity.validate()
Exemple #5
0
 def test_instance_creation(self):
     entity = Retraction(
         handle="*****@*****.**", target_guid="x"*16, entity_type="Post"
     )
     entity.validate()