Skip to content

Commit

Permalink
Updated failing tests after adding response type check.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunthercox committed Aug 9, 2016
1 parent 118c682 commit d3abef8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions chatterbot/training/trainers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from chatterbot.conversation import Statement
from chatterbot.conversation import Statement, Response
from chatterbot.corpus import Corpus


Expand Down Expand Up @@ -30,7 +30,9 @@ def train(self, conversation):
previous_statement = statement_history[-1]

if previous_statement:
statement.add_response(previous_statement)
statement.add_response(
Response(previous_statement.text)
)

statement_history.append(statement)
self.storage.update(statement)
Expand Down
4 changes: 2 additions & 2 deletions tests/storage_adapter_tests/test_jsondb_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_update_modifies_existing_statement(self):

# Update the statement value
statement.add_response(
Statement("New response")
Response("New response")
)
self.adapter.update(statement)

Expand Down Expand Up @@ -365,7 +365,7 @@ def test_update_does_not_modify_existing_statement(self):
self.adapter.read_only = True

statement.add_response(
Statement("New response")
Response("New response")
)

self.adapter.update(statement)
Expand Down

0 comments on commit d3abef8

Please sign in to comment.