GithubHelp home page GithubHelp logo

cscc43-a2-sql-queries-test's Introduction

Tests: SQL Queries in Assignment 2 (CSCC43 Summer 2021)

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/.

Requirements

Before running tests, install Pipenv and then run pipenv install from the project directory.

Follow these steps to get tests working

Step 1: Enter Shell

pipenv shell

Step 2: Add your queries

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.

Step 3: Configure PostgreSQL

Step 3(a): Set up a PostgreSQL database instance

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 

Step 3(b): Run a2DDL.sql

Run the Data Definition Language queries in your PostgreSQL console.

Step 3(c): Configure PostgreSQL database details

Update db = peewee.PostgresqlDatabase(... in test/utils/database.py with the appropriate credentials of your PostgreSQL instance.

Step 4: Run the tests

Repeat this step to check if all views have been dropped.

python -m unittest

cscc43-a2-sql-queries-test's People

Contributors

alvintangz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.