A service for the creation and management of materials.
The service is written using the Eve REST API framework (which itself is based on Flask) using MongoDB as its database.
- Python 2.7.15
- pip
- virtualenv
- MongoDB
-
Clone the repository
-
Create virtual environment
virtualenv venv
-
Activate virtual environment
source venv/bin/activate
-
Install the dependencies
pip install -r requirements.txt
Make sure MongoDB is installed and is running and that you have activated your virtual environment.
The environment variable EVE_ENV
can be used to set the environment of the
application (the default being development
if the variable is not set). The
application looks in the db directory to find a .py
file with the name of the
environment.
python run.py
python -m unittest discover -v -s tests -p "*tests.py"
This runs the single_test
test in the TestMaterials
class in the
materials_tests
module.
python -m unittest tests.materials_tests.TestMaterials.single_test
A setup.cfg
exists for the pycodestyle
linting package and can be used by installing it via
pip: pip install pycodestyle
. Once it's installed, it can be used via the command-line or an IDE
package.