Skip to content

Commit

Permalink
Fix test suite for accept
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Nov 24, 2019
1 parent 66c4800 commit 8576f22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions osclib/accept_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ def accept_all(self, projects, force=False, cleanup=True):
if self.api.item_exists(self.api.crebuild):
self.sync_buildfailures()

return True

def cleanup(self, project):
if not self.api.item_exists(project):
return False
return

pkglist = self.api.list_packages(project)
clean_list = set(pkglist) - set(self.api.cnocleanup_packages)
Expand All @@ -142,7 +144,7 @@ def cleanup(self, project):
print("[cleanup] deleted %s/%s" % (project, package))
delete_package(self.api.apiurl, project, package, force=True, msg="autocleanup")

return True
return

def fix_linking_packages(self, package):
project = self.api.project
Expand Down
1 change: 1 addition & 0 deletions osclib/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
'staging-required-checks-adi': '',
'installcheck-ignore-duplicated-binaries': '',
'onlyadi': '',
'nocleanup-packages': '',
'rings': '',
'rebuild': '',
'product': '',
Expand Down
4 changes: 2 additions & 2 deletions tests/accept_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def setup_wf(self):
def test_accept_comments(self):
wf = self.setup_wf()

self.assertEqual(True, AcceptCommand(wf.api).perform(self.prj))
self.assertEqual(True, AcceptCommand(wf.api).accept_all(['B']))

# Comments are cleared up
accepted_comments = self.c_api.get_comments(project_name=self.prj)
Expand All @@ -40,7 +40,7 @@ def test_accept_final_comment(self):
# snipe out cleanup to see the comments before the final countdown
wf.api.staging_deactivate = MagicMock(return_value=True)

self.assertEqual(True, AcceptCommand(wf.api).perform(self.prj))
self.assertEqual(True, AcceptCommand(wf.api).accept_all(['B']))

comments = self.c_api.get_comments(project_name=self.prj)
self.assertGreater(len(comments), len(self.comments))
Expand Down

0 comments on commit 8576f22

Please sign in to comment.