コード例 #1
0
 def test_cannot_detect_lang(self):
     urllib2.urlopen= fail_response(BaseRestClientError)
     self.assertRaises(BaseRestClientError, self.client.categories, u'pepe')
コード例 #2
0
 def test_no_classifiers(self):
     urllib2.urlopen= fail_response(BaseRestClientError)
     self.assertRaises(BaseRestClientError, self.client.categories, u'pepe')
コード例 #3
0
 def test_input_missing(self):
     urllib2.urlopen= fail_response(BaseRestClientError)
     self.assertRaises(BaseRestClientError, self.client.categories, u'pepe')
コード例 #4
0
 def test_cannot_detect_lang(self):
     urllib2.urlopen= fail_response(CannotDetectLanguageScoringError)
     self.assertRaises(CannotDetectLanguageScoringError, self.client.get_categories, u'text', u'pepe')
コード例 #5
0
 def test_missing_components(self):
     urllib2.urlopen= fail_response(MissingComponentsScoringError)
     self.assertRaises(MissingComponentsScoringError, self.client.get_categories, u'text', u'pepe')
コード例 #6
0
 def test_no_classifiers(self):
     urllib2.urlopen= fail_response(NoClassifiersScoringError)
     self.assertRaises(NoClassifiersScoringError, self.client.get_categories, u'text', u'pepe')