Skip to content

Commit

Permalink
TST: Test Twine.required_strands
Browse files Browse the repository at this point in the history
skipci
  • Loading branch information
cortadocodes committed Dec 12, 2024
1 parent f5db984 commit 1515ebf
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/test_twine.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,37 @@ def test_available_strands_properties(self):
)

self.assertEqual(twine.available_manifest_strands, {"output_manifest"})

def test_required_strands_property(self):
"""Test that the required strands property is correct."""
twines = [
{
"configuration_values_schema": {},
"input_values_schema": {},
"output_values_schema": {},
"output_manifest": {"datasets": {}},
},
{
"configuration_values_schema": {"optional": True},
"input_values_schema": {},
"output_values_schema": {},
"output_manifest": {"datasets": {}, "optional": True},
},
{
"configuration_values_schema": {"optional": False},
"input_values_schema": {},
"output_values_schema": {},
"output_manifest": {"datasets": {}, "optional": False},
},
]

expected_required_strands = [
{"configuration_values", "input_values", "output_values", "output_manifest"},
{"input_values", "output_values"},
{"configuration_values", "input_values", "output_values", "output_manifest"},
]

for twine, expected in zip(twines, expected_required_strands):
with self.subTest(twine=twine):
twine = Twine(source=twine)
self.assertEqual(twine.required_strands, expected)

0 comments on commit 1515ebf

Please sign in to comment.