Skip to content

Commit

Permalink
add test for check_type_of_param_value for patches
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed Sep 10, 2022
1 parent 6aa3459 commit 941886c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/framework/type_checking.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,25 @@ def test_check_type_of_param_value_checksums(self):
for inp in inputs:
self.assertEqual(check_type_of_param_value('checksums', inp), (True, inp))

def test_check_type_of_param_value_patches(self):
"""Test check_type_of_param_value function for patches."""

# patches values that do not need to be converted
inputs = (
[], # empty list of patches
# single patch, different types
['foo.patch'], # only filename
[('foo.patch', '1')], # filename + patch level
[('foo.patch', 'subdir')], # filename + subdir to apply patch in
[{'name': 'foo.patch', 'level': '1'}], # filename + patch level, as dict value
# multiple patches, mix of different types
['1.patch', '2.patch', '3.patch'],
['1.patch', ('2.patch', '2'), {'name': '3.patch'}],
['1.patch', {'name': '2.patch', 'level': '2'}, ('3.patch', '3')],
)
for inp in inputs:
self.assertEqual(check_type_of_param_value('patches', inp), (True, inp))

def test_convert_value_type(self):
"""Test convert_value_type function."""
# to string
Expand Down

0 comments on commit 941886c

Please sign in to comment.