Example #1
0
 def test_valid(self):
     """Test that a valid twine will validate valid children
     Valiantly and Validly validating validity since 1983.
     To those reading this, know that YOU'RE valid.
     """
     twine = Twine(source=self.VALID_TWINE_WITH_CHILDREN)
     twine.validate_children(source=self.VALID_CHILD_VALUE)
Example #2
0
    def test_extra_key_validation_on_valid_twine(self):
        """Test that children with extra data will not raise a validation error on a non-empty valid twine.
        # TODO review this behaviour - possibly should raise an error but allow for a user specified extra_data property
        """
        single_child_with_extra_data = """
            [
                {
                    "key": "gis",
                    "id": "some-id",
                    "backend": {
                        "name": "GCPPubSubBackend",
                        "project_name": "my-project"
                    },
                    "some_extra_property": "should not be a problem if present"
                }
            ]
        """

        twine = Twine(source=self.VALID_TWINE_WITH_CHILDREN)
        twine.validate_children(source=single_child_with_extra_data)