Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gunthercox committed Jan 5, 2025
1 parent 578848c commit 5f6ee9b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
mongodb-version: '8.0'
- name: Run tests
run: |
nosetests -vv
nosetests -v
- name: Run tests for Django example app
run: |
python setup.py develop
Expand Down
4 changes: 2 additions & 2 deletions tests/test_comparisons.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_exact_match_different_stopwords(self):

value = self.compare(statement, other_statement)

self.assertAlmostEqual(value, 0.9, places=1)
self.assertAlmostEqual(value, 0.7, places=1)

def test_exact_match_different_capitalization(self):
"""
Expand All @@ -92,7 +92,7 @@ def test_exact_match_different_capitalization(self):

value = self.compare(statement, other_statement)

self.assertAlmostEqual(value, 0.8, places=1)
self.assertAlmostEqual(value, 0.7, places=1)


class JaccardSimilarityTestCase(TestCase):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_tagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_tagging_german(self):
def test_string_becomes_lowercase(self):
tagged_text = self.tagger.get_text_index_string('THIS IS HOW IT BEGINS!')

self.assertEqual(tagged_text, 'DET:be VERB:how ADV:it NOUN:begin')
self.assertEqual(tagged_text, 'DET:be VERB:how ADV:it PRON:begin')

def test_tagging_medium_sized_words(self):
tagged_text = self.tagger.get_text_index_string('Hello, my name is Gunther.')
Expand All @@ -57,7 +57,7 @@ def test_tagging_medium_sized_words(self):
def test_tagging_long_words(self):
tagged_text = self.tagger.get_text_index_string('I play several orchestra instruments for pleasure.')

self.assertEqual(tagged_text, 'VERB:orchestra ADJ:instrument NOUN:pleasure')
self.assertEqual(tagged_text, 'VERB:orchestra NOUN:instrument NOUN:pleasure')

def test_get_text_index_string_punctuation_only(self):
bigram_string = self.tagger.get_text_index_string(
Expand Down Expand Up @@ -134,4 +134,4 @@ def test_get_text_index_string_two_character_words(self):
'Lo my mu it is of us'
)

self.assertEqual(bigram_string, 'VERB:mu')
self.assertEqual(bigram_string, 'PROPN:mu')
4 changes: 2 additions & 2 deletions tests/training/test_ubuntu_corpus_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def test_train_sets_search_text(self):
results = list(self.chatbot.storage.filter(text='Is anyone there?'))

self.assertEqual(len(results), 2)
self.assertEqual(results[0].search_text, 'VERB:anyone NOUN:there')
self.assertEqual(results[0].search_text, 'AUX:anyone PRON:there')

def test_train_sets_search_in_response_to(self):
"""
Expand All @@ -190,7 +190,7 @@ def test_train_sets_search_in_response_to(self):
results = list(self.chatbot.storage.filter(in_response_to='Is anyone there?'))

self.assertEqual(len(results), 2)
self.assertEqual(results[0].search_in_response_to, 'VERB:anyone NOUN:there')
self.assertEqual(results[0].search_in_response_to, 'AUX:anyone PRON:there')

def test_is_extracted(self):
"""
Expand Down

0 comments on commit 5f6ee9b

Please sign in to comment.