Skip to content

Commit e544baf

Browse files
committed
bug fix. need super constructor calls everywhere due to MRO
1 parent 6393710 commit e544baf

File tree

8 files changed

+25
-3
lines changed

8 files changed

+25
-3
lines changed

api/database/db_interface.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ class DBInterface(IQueue, IRatings, IAccounts, IRoster, ABC):
1010

1111
# All database implements must extend this class
1212

13+
def __init__(self):
14+
super().__init__()
15+
1316
@abstractmethod
1417
def connect(self):
1518
pass

api/database/idb_accounts.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from abc import ABC, abstractmethod
22

33

4-
class IAccounts:
4+
class IAccounts(ABC):
5+
6+
def __init__(self):
7+
super().__init__()
58

69
@abstractmethod
710
def create_account(self, ubit, pn):

api/database/idb_queue.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
class IQueue(ABC):
55

6+
def __init__(self):
7+
super().__init__()
8+
69
@abstractmethod
710
def enqueue_student(self, student):
811
raise NotImplementedError()

api/database/idb_ratings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from abc import ABC, abstractmethod
22

33

4-
class IRatings:
4+
class IRatings(ABC):
5+
6+
def __init__(self):
7+
super().__init__()
58

69
@abstractmethod
710
def rate_student(self, student, rating, feedback):

api/database/idb_roster.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from abc import ABC, abstractmethod
22

33

4-
class IRoster:
4+
class IRoster(ABC):
5+
6+
def __init__(self):
7+
super().__init__()
58

69
@abstractmethod
710
def add_to_roster(self, user_id, role):

api/database/testing_db/testing_db.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
class TestingDB(DBInterface, TestingDBQueue, TestingDBRatings, TestingDBAccounts):
99

10+
def __init__(self):
11+
super().__init__()
12+
1013
def connect(self):
1114
pass
1215

api/database/testing_db/testing_db_queue.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
class TestingDBQueue(IQueue):
55

66
def __init__(self):
7+
super().__init__()
78
self.queue = []
89

910
def enqueue_student(self, student):

api/database/testing_db/testing_db_ratings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
class TestingDBRatings(IRatings):
55

6+
def __init__(self):
7+
super().__init__()
8+
69
def rate_student(self, student, rating, feedback):
710
pass
811
# do database stuff

0 commit comments

Comments
 (0)