-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start adding integration tests for statement objects & models
- Loading branch information
1 parent
7f19e87
commit 601c41e
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
58 changes: 58 additions & 0 deletions
58
tests_django/integration_tests/test_statement_integration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
from django.test import TestCase | ||
from chatterbot.conversation import Statement as StatementObject | ||
from chatterbot.ext.django_chatterbot.models import Statement as StatementModel | ||
|
||
|
||
class StatementIntegrationTestCase(TestCase): | ||
""" | ||
Test case to make sure that the Django Statement model | ||
and ChatterBot Statement object have a common interface. | ||
""" | ||
def setUp(self): | ||
self.object = StatementObject(text='_') | ||
self.model = StatementModel(text='_') | ||
|
||
def test_text(self): | ||
self.assertTrue(hasattr(self.object, 'text')) | ||
self.assertTrue(hasattr(self.model, 'text')) | ||
|
||
def test_in_response_to(self): | ||
self.assertTrue(hasattr(self.object, 'in_response_to')) | ||
self.assertTrue(hasattr(self.model, 'in_response_to')) | ||
|
||
def test_extra_data(self): | ||
self.assertTrue(hasattr(self.object, 'extra_data')) | ||
self.assertTrue(hasattr(self.model, 'extra_data')) | ||
|
||
def test__str__(self): | ||
self.assertTrue(hasattr(self.object, '__str__')) | ||
self.assertTrue(hasattr(self.model, '__str__')) | ||
|
||
self.assertEqual(str(self.object), str(self.model)) | ||
|
||
def test_add_extra_data(self): | ||
self.object.add_extra_data('key', 'value') | ||
self.model.add_extra_data('key', 'value') | ||
|
||
def test_add_response(self): | ||
""" | ||
TODO: The add response method is deprecated. | ||
""" | ||
# self.object.add_response() | ||
# self.model.add_response() | ||
pass | ||
|
||
def test_set_in_response_to(self): | ||
pass | ||
|
||
def test_remove_response(self): | ||
pass | ||
|
||
def test_get_response_count(self): | ||
pass | ||
|
||
def test_serialize(self): | ||
pass | ||
|
||
def test_response_statement_cache(self): | ||
pass |