예제 #1
0
    def test_run(self, mock):
        """Tests to ensure a new `Issue` is persisted when the task is run."""
        mock.return_value = mock_trello_service()

        issues = Issue.query.all()
        self.assertTrue(len(issues) is 0)

        payload = json_fixture('./tests/fixtures/manual_comment.json')
        CreateManualCard.delay(board_id=default_board_id,
                               list_id=default_list_id,
                               name='test',
                               payload=payload)

        # Enqueuing new issue `CreateManualCard` should create an `Issue`
        new_issues = Issue.query.all()
        self.assertTrue(len(new_issues) is 1)
    def test_run(self, mock):
        """Tests to ensure a new `PullRequest` is persisted when run."""
        mock.return_value = mock_trello_service()

        pull_requests = PullRequest.query.all()
        self.assertTrue(len(pull_requests) is 0)

        payload = json_fixture('./tests/fixtures/pull_request_opened.json')
        CreatePullRequestCard.delay(
            board_id=default_board_id,
            list_id=default_list_id,
            name='Fake Pull Request',
            payload=payload
        )

        # Enqueuing new pull_request `CreatePullRequestCard` should create a
        # `PullRequest` record
        new_pull_requests = PullRequest.query.all()
        self.assertTrue(len(new_pull_requests) is 1)
예제 #3
0
 def __init__(self):
     self.trello_service = mock_trello_service(member_count=3)
예제 #4
0
 def lists_test_case(self):
     self.trello_service = mock_trello_service(
         board_count=2,
         list_counts=[2, 3]
     )
예제 #5
0
 def boards_test_case(self):
     self.trello_service = mock_trello_service(
         board_count=2,
         list_counts=[0, 0]
     )
 def __init__(self):
     self.trello_service = mock_trello_service(
         board_count=0,
         list_counts=[]
     )