elthran / UDK

A text-based empire strategy game
0 stars 0 forks source link

Add a unit test for the API #10

Closed elthran closed 3 years ago

elthran commented 3 years ago

It should be very simple. It just checks http://localhost:5000/api/counties/1 http://localhost:5000/api/users/1 and makes sure they return a county and user object. That way I can mess with the models and ensure that I'm still sending the front end the same data

klondikemarlen commented 3 years ago

Considering full suite with the following, but going for a basic pytest (https://flask.palletsprojects.com/en/1.1.x/testing/) for now.

# Pipenv
[dev-packages]
pytest = "*"
pytest-cov = "*"
pytest-flake8 = "*"
pytest-testmon = "*"
pytest-xdist = "*"
pytest-watch = "*"
pytest-spec = "*"
pytest-mock = "*"
# dev
test () {
  ptw --runner "python -m pytest --testmon --spec"
}