Updated script files to run tests on load
This commit is contained in:
parent
6d91fe8095
commit
f5a8cdcfa2
@ -6,6 +6,7 @@ from controllers.database.category import CategoryController
|
||||
|
||||
blueprint = Blueprint("products", __name__, url_prefix="/products")
|
||||
|
||||
# Context store for the categories to have them on every page
|
||||
@blueprint.context_processor
|
||||
def category_list():
|
||||
database = CategoryController()
|
||||
|
@ -8,6 +8,7 @@ services:
|
||||
- APPSECRET=test
|
||||
- ENVIRON=test
|
||||
# - ENVIRON=prod
|
||||
tty: true
|
||||
ports:
|
||||
- "5000:5000"
|
||||
volumes:
|
||||
|
@ -3,5 +3,5 @@ COPY ./requirements.txt /app/requirements.txt
|
||||
WORKDIR /app
|
||||
RUN pip install -r requirements.txt
|
||||
COPY . /app
|
||||
RUN chmod +x scripts/run.sh
|
||||
CMD ["sh", "scripts/run.sh"]
|
||||
RUN chmod +x scripts/run.bash
|
||||
CMD ["bash", "scripts/run.bash"]
|
2
scripts/run.bash
Normal file
2
scripts/run.bash
Normal file
@ -0,0 +1,2 @@
|
||||
#! /bin/bash
|
||||
pytest --disable-warnings && python ./scripts/create_database.py && python ./app.py
|
@ -1,4 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
python ./scripts/create_database.py
|
||||
python ./app.py
|
@ -11,3 +11,27 @@ INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALU
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 4);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 6);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 6);
|
||||
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 2);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 2);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 3);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 4);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 4);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 4);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 6);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 6);
|
||||
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 1);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 2);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 2);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 3);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 4);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 4);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 4);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 6);
|
||||
INSERT INTO Products (name, image, description, cost, sellerID, categoryID) VALUES ("test", "assets/img/wmgzon.png", "this is a product", 20.99, 1, 6);
|
Loading…
Reference in New Issue
Block a user