예제 #1
0
 def test_instance_creation(self):
     entity = Image(guid="x" * 16,
                    handle="*****@*****.**",
                    public=False,
                    remote_path="foobar",
                    remote_name="barfoo")
     entity.validate()
예제 #2
0
 def test_validate_children(self):
     post = PostFactory()
     image = Image()
     profile = Profile()
     post._children = [image]
     post._validate_children()
     post._children = [profile]
     with pytest.raises(ValueError):
         post._validate_children()
예제 #3
0
 def test_required_fields(self):
     entity = Image(
         guid="x" * 16, handle="*****@*****.**", public=False, remote_name="barfoo"
     )
     with pytest.raises(ValueError):
         entity.validate()
     entity = Image(
         guid="x" * 16, handle="*****@*****.**", public=False, remote_path="foobar"
     )
     with pytest.raises(ValueError):
         entity.validate()
예제 #4
0
 def test_required_fields(self):
     entity = Image(
         guid="x" * 16, handle="*****@*****.**", public=False, remote_name="barfoo"
     )
     with pytest.raises(ValueError):
         entity.validate()
     entity = Image(
         guid="x" * 16, handle="*****@*****.**", public=False, remote_path="foobar"
     )
     with pytest.raises(ValueError):
         entity.validate()
예제 #5
0
 def test_instance_creation(self):
     entity = Image(
         guid="x"*16, handle="*****@*****.**", public=False, remote_path="foobar", remote_name="barfoo"
     )
     entity.validate()