update,
This commit is contained in:
32
daniel_jo/ITP4459_assignment_2023/tests/test_models.py
Normal file
32
daniel_jo/ITP4459_assignment_2023/tests/test_models.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from pprint import pprint
|
||||
|
||||
import constants
|
||||
|
||||
from db import MySQLConnection
|
||||
from models import Programme
|
||||
from models import Module
|
||||
|
||||
db = MySQLConnection(
|
||||
host=constants.DB_HOST,
|
||||
user=constants.DB_USER,
|
||||
password=constants.DB_PASS
|
||||
)
|
||||
|
||||
list_program = Programme.fetchall(db)
|
||||
list_module = Module.fetchall(db)
|
||||
|
||||
# print(list_program[0].get_modules())
|
||||
# print(list_program[0].get_modules_by_semester(1))
|
||||
# print(list_program[0].get_name())
|
||||
# __eq__
|
||||
# print(list_program[0] == list_program[0])
|
||||
|
||||
# modules
|
||||
# print(list_program[0].get_modules()[1][0][0].get_id())
|
||||
# pprint(list_program[0].get_modules())
|
||||
# pprint(list_program[0].get_modules_by_semester(1)[0])
|
||||
# print(list_program[0].get_modules()[1][0][0].get_credit())
|
||||
|
||||
db.close()
|
||||
|
||||
#
|
Reference in New Issue
Block a user