Skip to content

Commit

Permalink
TST: Test missing optional strands don't raise errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cortadocodes committed Dec 12, 2024
1 parent 1515ebf commit ca87356
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_manifest_strands.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,8 @@ def test_error_raised_if_multiple_datasets_have_same_name(self):

with self.assertRaises(KeyError):
twine.validate_input_manifest(source=input_manifest)

def test_missing_optional_manifest_does_not_raise_error(self):
"""Test that not providing an optional strand doesn't result in a validation error."""
twine = Twine(source={"output_manifest": {"datasets": {}, "optional": True}})
twine.validate(output_manifest=None)
5 changes: 5 additions & 0 deletions tests/test_schema_strands.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ def test_valid_with_extra_values(self):

Twine(source=VALID_SCHEMA_TWINE).validate_configuration_values(source=configuration_valid_with_extra_field)

def test_missing_optional_values_do_not_raise_error(self):
"""Test that not providing an optional strand doesn't result in a validation error."""
twine = Twine(source={"configuration_values_schema": {"optional": True}})
twine.validate(configuration_values=None)


if __name__ == "__main__":
unittest.main()

0 comments on commit ca87356

Please sign in to comment.