Skip to content

Commit

Permalink
add tests for app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-hsieh committed Feb 6, 2024
1 parent e6159d3 commit 067be2c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ def calculate_most_points_get():
result_dict = {}
contest = 'total_lb_points'
points = get_most_position_points(contest_list[contest]['position'],
contest_list[contest]['stat'],
OWNERS,
'2023',
current_week() - 1)
result_dict['contest_results'] = order_positions_by_points(points)
result_dict['contest'] = contest
Expand Down
3 changes: 0 additions & 3 deletions fantasy_app/test_app.py

This file was deleted.

Empty file added fantasy_app/test_scores.py
Empty file.
13 changes: 13 additions & 0 deletions test_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from app import app

def test_hello1_route():
response = app.test_client().get('/')
json_response = response.get_json()
assert json_response == 'This is working'
assert response.status_code == 200

def test_calculate_most_points_get():
response = app.test_client().get('/most_points_get')
json_response = response.get_json()
assert list(json_response.keys()) == ['contest', 'contest_results']
assert response.status_code == 200

0 comments on commit 067be2c

Please sign in to comment.