uptake / updoc

An application for serving documentation in a cloud environment
BSD 3-Clause "New" or "Revised" License
9 stars 1 forks source link

Unit test framework #6

Open jameslamb opened 5 years ago

jameslamb commented 5 years ago

This project currently has no unit tests. To close this issue, just PR in a basic framework for testing (i.e. the basic structure and some minimal tests).

Haoen-Cui commented 4 years ago

@jameslamb Thanks for pointing this out. I have quite minimal experience with python flask apps, not even mentioning testing framework for it.

jameslamb commented 4 years ago

I can't contribute this at this time. A first pass would be to set up very basic Travis that just runs python setup.py install to at least get PR build failures if the package can't be installed. You could look at how I set it up for doppel-cli but that is probably overkill for what you want (https://github.com/jameslamb/doppel-cli). See the .travis.yml file there.

I can't think of a good example right now for a simple setup for a Python project with a web service. I would start with the "get it installing" test and go from there.

Consider the docker on Travis option as a way to build and run the service. You could also ask @austin3dickey to point you to some examples of a cool project called responses which I really like for mocking HTTP requests (https://github.com/getsentry/responses).