def test_pull_request_opened_by_organization_member(self, mock): """Tests that the `CreatePullRequestCard` is not enqueued.""" payload = json_fixture('./tests/fixtures/pull_request_opened.json') GitHubReceiver.delay(payload=payload) # It does not enqueue the `CreatePullRequestCard` task mock.assert_not_called()
def test_issue_opened_by_external_contributor(self, mock): """Tests that the `CreateIssueCard` is not enqueued.""" payload = json_fixture('./tests/fixtures/issue_opened.json') GitHubReceiver.delay(payload=payload) # It does not enqueue the `CreateIssueCard` task mock.assert_not_called()
def test_closed_event(self, mock): """Tests `DeleteCardObjectFromDatabase` is enqueued.""" create_issue() payload = json_fixture('./tests/fixtures/issue_closed.json') GitHubReceiver.delay(payload=payload) mock.assert_called_once()
def test_manual_command_by_organization_member(self, mock): """Tests `CreateManualCard` is not enqueued.""" payload = json_fixture('./tests/fixtures/manual_comment.json') GitHubReceiver.delay(payload=payload) mock.assert_not_called()
def test_pull_request_opened_by_external_contributor(self, mock): """Tests `CreatePullRequestCard` is enqueued.""" payload = json_fixture('./tests/fixtures/pull_request_opened.json') GitHubReceiver.delay(payload=payload) mock.assert_called_once()
def test_issue_opened_by_organization_member(self, mock): """Tests `CreateIssueCard` is not enqueued.""" payload = json_fixture('./tests/fixtures/issue_opened.json') GitHubReceiver.delay(payload=payload) mock.assert_not_called()
def test_manual_command_by_external_contributor(self, mock): """Tests `CreateManualCard` is enqueued.""" payload = json_fixture('./tests/fixtures/manual_comment.json') GitHubReceiver.delay(payload=payload) mock.assert_not_called()