-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestCases.py
36 lines (25 loc) · 987 Bytes
/
testCases.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#Test that postgres and mysql modules are functioning correctly
from cursesPostgres import queryPostgresDict
login_info = {'username': 'postgres', 'password': '', 'database': 'world'}
print "Testing Postgres module:"
print "Should be success:"
print queryPostgresDict(login_info, "SELECT * FROM COUNTRY LIMIT 3")
print "Should fail:"
print queryPostgresDict(login_info, "SELECT * FROM COUNTR")
print "Should fail:"
print queryPostgresDict(login_info, "SELECT * FROM COUNTRY")
print "Should fail:"
print queryPostgresDict(login_info, "SELECT * FROM COUNTRY")
#Queries to use for testing:
#get all tables from database
#MySQL: SHOW TABLES from world
#postgres: SELECT table_name FROM information_schema.tables WHERE table_schema='public' AND table_type='BASE TABLE'
#get all rows from table
#MySQL: SELECT * FROM Cities
#postgres: SELECT * FROM Cities
#drop/add table from database
#MySQL:CREATE TABLE test_table LIKE Cities
#postgres:
#drop/add row to table
#MySQL:
#postgres: