-
Notifications
You must be signed in to change notification settings - Fork 4
/
databaseTests.py
52 lines (40 loc) · 1.27 KB
/
databaseTests.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from Database import Database
def main():
#Setup
db = Database()
db.setup()
#User Commands
db.addUser("Suyash", 231)
print(db.getChatID("Suyash"))
print(db.getUsername(231))
print(db.getChatID("Suysdash"))
print(db.getUsername(12223))
# db.addEntryToTotals("Suyash", "Haozhe", 396.23)
print(db.moneyOwed("Suyash", "Haozhe"))
print(db.moneyOwed("Haozhe", "Suyash"))
print(db.moneyOwed("Shitian", "Suyash"))
print(db.moneyOwed("Haozhe", "Junkai"))
db.addReceipt("Haozhe", "Junkai", "Firecracker Chicken", 4.50)
db.addReceipt("Haozhe", "Junkai", "Dabao", 4.50)
db.addReceipt("Junkai", "Haozhe", "Dabao", 60)
db.addReceipt("Haozhe", "Junkai", "Dabao", 200)
db.addReceipt("shitian95", "Haozhe321", "Dabao", 200)
print("Self-history:")
db.selfHistory("Junkai")
db.history("Junkai")
db.hasNotPaid("Haozhe")
db.hasNotPaid("Junkai")
db.hasNotPaid("shitian95")
db.owesMoneyTo("Suyash")
db.hasNotPaid("Haozhe")
db.hasNotPaid("Junkai")
db.hasNotPaid("Suyash")
db.printTable("receipt")
print(" ")
db.paidEverything("Haozhe", "Shitian")
print(" ")
db.transactionHistory("Haozhe", "Junkai")
print(" ")
db.printTable("total")
if __name__ == '__main__':
main()