From 51d631daf6ff824ca29886f546dce6e7af26b3f5 Mon Sep 17 00:00:00 2001 From: Andrei Stoica Date: Wed, 19 Apr 2023 18:42:56 -0400 Subject: [PATCH] added blurb about testing --- README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 620cf65..5f7cd02 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ POSTGRES_DB=rgraph Start database ```sh -docker-compose up +docker-compose -p recipe-dev up ``` Example `sites.json` @@ -41,6 +41,11 @@ python src/db.py python src/insert_sites.py data/sites.json ``` +Shutdown database +```sh +docker-compose -p recipe-dev down +``` + ## Usage ### Scrape import new recipes @@ -72,6 +77,31 @@ options: -v, --verbose ``` +## Testing +For testing create a new set up docker containers. Tests will fail if +the database is already initiated. + +Starting testing db +```sh +docker-compose -p recipe-test up +``` + +running tests +```sh +pytest +``` + +**WARNINING**: If you get `ERROR at setup of test_db_connection` and +`ERROR at setup of test_db_class_creation`, please check if testing database is +already initiated. Testing is destructive and should be done on a fresh database. + + +Shutting down testing db +```sh +docker-compose -p recipe-test down +``` + + ## TODO > ☑ automate scraping\ > ☑ extracting quantity and name (via regex)\