Skip to content

Commit

Permalink
fix: correct tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Sep 7, 2021
1 parent cbf7c13 commit 69cce33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

@pytest.fixture
def mock_client():
return app.API.test_client()
return app.APP.test_client()


@pytest.fixture
Expand Down
6 changes: 6 additions & 0 deletions test/unit/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ def test_routes_are_reachable_get(mock_client, route):
assert response.status_code == 200


def test_routes_not_found(mock_client):
response = mock_client.get('bad_route')

assert response.status_code == 404


@patch('harvey.webhooks.Webhook.parse_webhook')
def test_start_pipeline(mock_parse_webhook):
# TODO: Long-term, test the status_code and logic
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_webhook_originated_outside_github(mock_webhook_object):
webhook = Webhook.parse_webhook(mock_webhook_object)

assert webhook[0] == {
'message': 'Webhook did not originate from GitHub.',
'message': 'Request did not originate from GitHub.',
'success': False,
}
assert webhook[1] == 422

0 comments on commit 69cce33

Please sign in to comment.