Skip to content

Commit

Permalink
Fix test suite #16
Browse files Browse the repository at this point in the history
Add `alternate_names` to test data
  • Loading branch information
osteele committed May 8, 2017
1 parent c81176d commit 56ac112
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion conversationHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def find_tools_in_message(self, message):
"""
found_tools = []
tools_list = self.database_client.get_all_tools()
# loop through list looking for tool names in message
# find tools with a name or alternate_names in the message
for tool in tools_list:
if tool['name'] in message:
found_tools.append(tool)
Expand Down
3 changes: 3 additions & 0 deletions fakeDatabaseClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
"$oid": "58ebabe3638acc000b2e2429"
},
"name": "screwdriver",
"alternate_names": [],
"current_due_date": 1492100080
}, {
"_id": {
"$oid": "58e5528dbf24551abe306610"
},
"current_due_date": 1491424505,
"name": "drill",
"alternate_names": [],
"current_user": {
"$oid": "58dfe761db78bb000bf7c88b"
}
Expand All @@ -22,6 +24,7 @@
"$oid": "58e5528dbf24551abe306611"
},
"name": "arduino",
"alternate_names": [],
"current_due_date": None,
"current_user": None
}]
Expand Down
14 changes: 6 additions & 8 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,16 @@ def test_find_tools_in_message(self):
"current_user": {
"$oid": "58ebabe3638acc000b2e2429"
},
"name":
"screwdriver",
"current_due_date":
1492100080
"name": "screwdriver",
"alternate_names": [],
"current_due_date": 1492100080
}, {
"_id": {
"$oid": "58e5528dbf24551abe306610"
},
"current_due_date":
1491424505,
"name":
"drill",
"current_due_date": 1491424505,
"name": "drill",
"alternate_names": [],
"current_user": {
"$oid": "58dfe761db78bb000bf7c88b"
}
Expand Down

0 comments on commit 56ac112

Please sign in to comment.