diff --git a/tests/test_children.py b/tests/test_children.py index 60263cf..ecacf56 100644 --- a/tests/test_children.py +++ b/tests/test_children.py @@ -87,6 +87,13 @@ def test_extra_children(self): with self.assertRaises(exceptions.InvalidValuesContents): Twine().validate_children(source=self.VALID_CHILD_VALUE) + def test_backend_cannot_be_empty(self): + """ Test that the backend field of a child cannot be empty. """ + single_child_missing_backend = """[{"key": "gis", "id": "some-id", "backend": {}}]""" + + with self.assertRaises(exceptions.InvalidValuesContents): + Twine().validate_children(source=single_child_missing_backend) + def test_extra_key_validation_on_empty_twine(self): """ Test that children with extra data will not raise a validation error on an empty twine. """ diff --git a/twined/schema/children_schema.json b/twined/schema/children_schema.json index 2ea7f79..abe6114 100644 --- a/twined/schema/children_schema.json +++ b/twined/schema/children_schema.json @@ -32,7 +32,8 @@ "description": "Absolute path to Google Cloud Platform credentials JSON file.", "type": "string" } - } + }, + "required": ["name", "project_name", "credentials_filename"] } ] }