예제 #1
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()
예제 #2
0
 def test_retraction_is_converted_to_diasporaretraction(self, private_key):
     entity = Retraction()
     assert isinstance(get_outbound_entity(entity, private_key),
                       DiasporaRetraction)
예제 #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()
예제 #4
0
 def test_instance_creation(self):
     entity = Retraction(
         handle="*****@*****.**", target_guid="x"*16, entity_type="Post"
     )
     entity.validate()
예제 #5
0
 def test_instance_creation(self):
     entity = Retraction(
         handle="*****@*****.**", target_guid="x"*16, entity_type="Post"
     )
     entity.validate()