Skip to content

Commit

Permalink
Adding system test for analyze_sentiment() in language.
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Aug 25, 2016
1 parent 645c086 commit 127e8ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions system_tests/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,10 @@ def test_analyze_entities_from_blob(self):
document = Config.CLIENT.document_from_url(gcs_url)
entities = document.analyze_entities()
self._check_analyze_entities_result(entities)

def test_analyze_sentiment(self):
positive_msg = 'Jogging is fun'
document = Config.CLIENT.document_from_text(positive_msg)
sentiment = document.analyze_sentiment()
self.assertEqual(sentiment.polarity, 1)
self.assertTrue(0.5 < sentiment.magnitude < 1.5)

0 comments on commit 127e8ae

Please sign in to comment.