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