summaryrefslogtreecommitdiff
path: root/tests/test_rpm.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_rpm.py')
-rw-r--r--tests/test_rpm.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/test_rpm.py b/tests/test_rpm.py
index 9d5a49bb..4d430778 100644
--- a/tests/test_rpm.py
+++ b/tests/test_rpm.py
@@ -156,7 +156,7 @@ class TestSpecFile(object):
reference_spec = os.path.join(SPEC_DIR, 'gbp-test-reference.spec')
spec = SpecFile(tmp_spec)
- spec.update_patches(['new.patch'])
+ spec.update_patches([('new.patch', None)])
spec.write_spec_file()
assert filecmp.cmp(tmp_spec, reference_spec) is True
@@ -173,14 +173,15 @@ class TestSpecFile(object):
reference_spec = os.path.join(SPEC_DIR, 'gbp-test2-reference2.spec')
spec = SpecFile(tmp_spec)
- spec.update_patches(['1.patch', '2.patch'])
+ spec.update_patches([('1.patch', {'if': 'true'}),
+ ('2.patch', {'ifarch': '%ix86'})])
spec.set_tag('VCS', None, 'myvcstag')
- spec.update_patches(['new.patch'])
spec.write_spec_file()
assert filecmp.cmp(tmp_spec, reference_spec) is True
- # Test removing the VCS tag
+ # Test updating patches again and removing the VCS tag
reference_spec = os.path.join(SPEC_DIR, 'gbp-test2-reference.spec')
+ spec.update_patches([('new.patch', {'if': '1'})])
spec.set_tag('VCS', None, '')
spec.write_spec_file()
assert filecmp.cmp(tmp_spec, reference_spec) is True
@@ -263,10 +264,11 @@ class TestSpecFile(object):
spec = SpecFileTester(spec_filepath)
assert len(spec.patchseries()) == 0
- spec.update_patches(['1.patch', '2.patch', '3.patch'])
+ spec.update_patches([('1.patch', None), ('2.patch', None),
+ ('3.patch', None)])
assert len(spec.patchseries()) == 3
spec.protected('_gbp_tags')['ignore-patches'].append({'args': "0"})
- spec.update_patches(['4.patch'])
+ spec.update_patches([('4.patch', None)])
assert len(spec.patchseries()) == 1
assert len(spec.patchseries(ignored=True)) == 2
spec.protected('_delete_special_macro')('patch', 0)