Esempio n. 1
0
    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()
Esempio n. 2
0
    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()
Esempio n. 3
0
 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()
Esempio n. 4
0
 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()
Esempio n. 5
0
 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()
Esempio n. 6
0
 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()
Esempio n. 7
0
 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()