-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Populate signoffs with a commit message of the tag in extra-testing, …
…not the latest commit Fixes #533
- Loading branch information
Showing
2 changed files
with
11 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,18 +26,18 @@ def tearDown(self): | |
self.package.delete() | ||
|
||
def test_basic(self): | ||
with mock.patch('packages.management.commands.populate_signoffs.get_last_log') as get_last_log: | ||
with mock.patch('packages.management.commands.populate_signoffs.get_tag_info') as get_tag_info: | ||
comment = 'upgpkg: 0.1-1: rebuild' | ||
get_last_log.return_value = {'message': f'{comment}\n', 'author': '[email protected]'} | ||
get_tag_info.return_value = {'message': f'{comment}\n', 'author': '[email protected]'} | ||
call_command('populate_signoffs') | ||
|
||
signoff_spec = SignoffSpecification.objects.first() | ||
assert signoff_spec.comments == comment | ||
assert signoff_spec.pkgbase == self.package.pkgbase | ||
|
||
def test_invalid(self): | ||
with mock.patch('packages.management.commands.populate_signoffs.get_last_log') as get_last_log: | ||
get_last_log.return_value = None | ||
with mock.patch('packages.management.commands.populate_signoffs.get_tag_info') as get_tag_info: | ||
get_tag_info.return_value = None | ||
call_command('populate_signoffs') | ||
|
||
assert SignoffSpecification.objects.count() == 0 |