diff --git a/pagure/lib/tasks_services.py b/pagure/lib/tasks_services.py index 0098f87..df974ad 100644 --- a/pagure/lib/tasks_services.py +++ b/pagure/lib/tasks_services.py @@ -18,8 +18,6 @@ import os.path import time import uuid - -import pygit2 import requests import six diff --git a/tests/test_pagure_flask_api_group.py b/tests/test_pagure_flask_api_group.py index 870347b..972955e 100644 --- a/tests/test_pagure_flask_api_group.py +++ b/tests/test_pagure_flask_api_group.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- """ - (c) 2017 - Copyright Red Hat Inc + (c) 2017-2018 - Copyright Red Hat Inc Authors: Matt Prahl + Pierre-Yves Chibon """ @@ -319,6 +320,8 @@ class PagureFlaskApiGroupTests(tests.SimplePagureTest): "fedmsg_notifications": True, "issue_tracker": True, "issues_default_to_private": False, + "notify_on_commit_flag": False, + "notify_on_pull-request_flag": False, "project_documentation": False, "pull_request_access_only": False, "pull_requests": True, @@ -410,6 +413,8 @@ class PagureFlaskApiGroupTests(tests.SimplePagureTest): "fedmsg_notifications": True, "issue_tracker": True, "issues_default_to_private": False, + "notify_on_commit_flag": False, + "notify_on_pull-request_flag": False, "project_documentation": False, "pull_request_access_only": False, "pull_requests": True, @@ -497,6 +502,8 @@ class PagureFlaskApiGroupTests(tests.SimplePagureTest): "fedmsg_notifications": True, "issue_tracker": True, "issues_default_to_private": False, + "notify_on_commit_flag": False, + "notify_on_pull-request_flag": False, "project_documentation": False, "pull_request_access_only": False, "pull_requests": True, diff --git a/tests/test_pagure_flask_api_user.py b/tests/test_pagure_flask_api_user.py index fedca67..1651151 100644 --- a/tests/test_pagure_flask_api_user.py +++ b/tests/test_pagure_flask_api_user.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - (c) 2015-2016 - Copyright Red Hat Inc + (c) 2015-2018 - Copyright Red Hat Inc Authors: Pierre-Yves Chibon @@ -131,6 +131,8 @@ class PagureFlaskApiUSertests(tests.Modeltests): "fedmsg_notifications": True, "issue_tracker": True, "issues_default_to_private": False, + "notify_on_commit_flag": False, + "notify_on_pull-request_flag": False, "pull_request_access_only": False, "project_documentation": False, "pull_requests": True, @@ -181,6 +183,8 @@ class PagureFlaskApiUSertests(tests.Modeltests): "fedmsg_notifications": True, "issue_tracker": True, "issues_default_to_private": False, + "notify_on_commit_flag": False, + "notify_on_pull-request_flag": False, "pull_request_access_only": False, "project_documentation": False, "pull_requests": True, @@ -230,6 +234,8 @@ class PagureFlaskApiUSertests(tests.Modeltests): "fedmsg_notifications": True, "issue_tracker": True, "issues_default_to_private": False, + "notify_on_commit_flag": False, + "notify_on_pull-request_flag": False, "project_documentation": False, "pull_request_access_only": False, "pull_requests": True, diff --git a/tests/test_pagure_lib.py b/tests/test_pagure_lib.py index 7f6ea3a..654b1ef 100644 --- a/tests/test_pagure_lib.py +++ b/tests/test_pagure_lib.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - (c) 2015-2017 - Copyright Red Hat Inc + (c) 2015-2018 - Copyright Red Hat Inc Authors: Pierre-Yves Chibon @@ -932,7 +932,7 @@ class PagureLibtests(tests.Modeltests): folder=None) self.session.commit() self.assertEqual(msg, 'Comment updated') - self.assertEqual(mock_redis.publish.call_count, 2) + self.assertEqual(mock_redis.publish.call_count, 1) # After issue = pagure.lib.search_issues(self.session, repo, issueid=1) @@ -989,7 +989,7 @@ class PagureLibtests(tests.Modeltests): self.assertFalse(issue.project.private) args = mock_redis.publish.call_args_list - self.assertEqual(len(args), 8) + self.assertEqual(len(args), 4) # Add a tag to the issue msg = pagure.lib.add_tag_obj( @@ -1002,7 +1002,7 @@ class PagureLibtests(tests.Modeltests): self.assertEqual(msg, 'Issue tagged with: tag1') args = mock_redis.publish.call_args_list - self.assertEqual(len(args), 10) + self.assertEqual(len(args), 5) # Get the arguments of the last call and get the second of these # arguments (the first one changing for each test run) self.assertEqual( @@ -2550,7 +2550,7 @@ class PagureLibtests(tests.Modeltests): mock_redis.return_value = True self.test_new_pull_request() - self.assertEqual(mock_redis.publish.call_count, 3) + self.assertEqual(mock_redis.publish.call_count, 1) # Let's pretend we turned on the CI hook for the project project = pagure.lib._get_project(self.session, 'test') @@ -2582,7 +2582,7 @@ class PagureLibtests(tests.Modeltests): self.assertEqual(len(request.discussion), 0) self.assertEqual(len(request.comments), 1) self.assertEqual(request.score, 0) - self.assertEqual(mock_redis.publish.call_count, 7) + self.assertEqual(mock_redis.publish.call_count, 4) @patch('pagure.lib.notify.send_email') def test_add_pull_request_flag(self, mockemail): @@ -5676,7 +5676,7 @@ foo bar self.assertEqual( msg, 'Custom field tested reset (from true)') - self.assertEqual(mock_redis.publish.call_count, 3) + self.assertEqual(mock_redis.publish.call_count, 2) @patch('pagure.lib.REDIS') def test_set_custom_key_value_boolean_private_issue(self, mock_redis): @@ -5798,7 +5798,7 @@ foo bar self.assertEqual( msg, 'Custom field tested adjusted to Done (was: In progress)') - self.assertEqual(mock_redis.publish.call_count, 3) + self.assertEqual(mock_redis.publish.call_count, 2) def test_log_action_invalid(self): """ Test the log_action function of pagure.lib. """ diff --git a/tests/test_pagure_lib_git.py b/tests/test_pagure_lib_git.py index c3c1706..3202651 100644 --- a/tests/test_pagure_lib_git.py +++ b/tests/test_pagure_lib_git.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ - (c) 2015-2017 - Copyright Red Hat Inc + (c) 2015-2018 - Copyright Red Hat Inc Authors: Pierre-Yves Chibon @@ -1844,7 +1844,7 @@ new file mode 100644 index 0000000..60f7480 --- /dev/null +++ b/456 -@@ -0,0 +1,133 @@ +@@ -0,0 +1,137 @@ +{ + "assignee": null, + "branch": "master", @@ -1894,6 +1894,8 @@ index 0000000..60f7480 + "fedmsg_notifications": true, + "issue_tracker": true, + "issues_default_to_private": false, ++ "notify_on_commit_flag": false, ++ "notify_on_pull-request_flag": false, + "project_documentation": false, + "pull_request_access_only": false, + "pull_requests": true, @@ -1947,6 +1949,8 @@ index 0000000..60f7480 + "fedmsg_notifications": true, + "issue_tracker": true, + "issues_default_to_private": false, ++ "notify_on_commit_flag": false, ++ "notify_on_pull-request_flag": false, + "project_documentation": false, + "pull_request_access_only": false, + "pull_requests": true,