Skip to content

Commit

Permalink
fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
condecon committed Nov 19, 2024
1 parent e9f1f71 commit 1969d8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion adaptivetesting/models/__test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self):
self.c: float = 0
self.d: float = 1

def __dict__(self):
def as_dict(self) -> dict[str, float]:
return {
"a": self.a,
"b": self.b,
Expand Down
8 changes: 4 additions & 4 deletions adaptivetesting/tests/test_load_test_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, methodName = "runTest"):
self.item2.c = 1.9

def test_load_test_items_from_dict_success(self):
source_dictionary = {
source_dictionary: dict[str, list[float]] = {
"a": [0.9, 1.9],
"b": [5, 3],
"c": [0.9, 1.9],
Expand All @@ -24,10 +24,10 @@ def test_load_test_items_from_dict_success(self):

generated = load_test_items_from_dict(source_dictionary)

self.assertEqual([self.item1.__dict__(), self.item2.__dict__()], [i.__dict__() for i in generated])
self.assertEqual([self.item1.as_dict(), self.item2.as_dict()], [i.as_dict() for i in generated])

def test_load_test_items_from_dict_error_none(self):
source_dictionary = {
source_dictionary: dict[str, list[float]] = {
"a": [0.9, 1.9],
"b": [5, 3],
"c": [0.9, 1.9],
Expand All @@ -37,7 +37,7 @@ def test_load_test_items_from_dict_error_none(self):
load_test_items_from_dict(source_dictionary)

def test_load_test_items_from_dict_error_length(self):
source_dictionary = {
source_dictionary: dict[str, list[float]] = {
"a": [0.9, 1.9],
"b": [5, 3],
"c": [0.9, 1.9],
Expand Down

0 comments on commit 1969d8f

Please sign in to comment.