This project allows you to test the SQL Queries part of Assignment 2 (CSCC43 Summer 2021) using Python's unittest
framework. Feel free to add any tests in test/
.
Before running tests, install Pipenv
and then run pipenv install
from the project directory.
pipenv shell
In test/test_q1.py
to test/test_q7.py
, update query
instance variable in each test case with the query you want to test.
First, set up a PostgreSQL database. On Docker, you can simply spin up a container:
docker run -p 5433:5432 -e POSTGRES_PASSWORD=Password@123 -d postgres
Run the Data Definition Language queries in your PostgreSQL console.
Update db = peewee.PostgresqlDatabase(...
in test/utils/database.py
with the appropriate credentials of your PostgreSQL instance.
Repeat this step to check if all views have been dropped.
python -m unittest