-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unit tests #79
Comments
What's the strategy you're thinking of for these tests? |
@leighlondon I've start some testing on For the most part, I want to test the API to make sure it is giving the results I expect it to give. There should be similar tests for (I don't consider unit tests as something which should test the validity of the data. That's another can of worms.) |
I'd be interested in adding some tests to this if it'd help out. # tests/test_game.py
from nflgame.game import FieldPosition, PossessionTime
class TestPossessionTime:
def test_minutes_to_total_seconds(self):
clock = PossessionTime("5:00")
assert clock.total_seconds() == 300
# ...
class TestFieldPosition:
def test_offset_redzone_yards_correct(self):
fp = FieldPosition(yardline="NYJ 2", pos_team="NE")
assert fp.offset == 48
# ... I take it you mean something like that for the API tests, so that it's data-agnostic but testing the base classes and functions? |
Yes, that looks reasonable. You can certainly rely on expecting certain data values for your tests. Although, please use Thanks. :D |
This must be done before porting to Python 3. #78
Strategy to come shortly.
The text was updated successfully, but these errors were encountered: