예제 #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()
예제 #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()
예제 #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()
예제 #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()
예제 #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()
예제 #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()
예제 #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()