def test_cannot_detect_lang(self): urllib2.urlopen= fail_response(BaseRestClientError) self.assertRaises(BaseRestClientError, self.client.categories, u'pepe')
def test_no_classifiers(self): urllib2.urlopen= fail_response(BaseRestClientError) self.assertRaises(BaseRestClientError, self.client.categories, u'pepe')
def test_input_missing(self): urllib2.urlopen= fail_response(BaseRestClientError) self.assertRaises(BaseRestClientError, self.client.categories, u'pepe')
def test_cannot_detect_lang(self): urllib2.urlopen= fail_response(CannotDetectLanguageScoringError) self.assertRaises(CannotDetectLanguageScoringError, self.client.get_categories, u'text', u'pepe')
def test_missing_components(self): urllib2.urlopen= fail_response(MissingComponentsScoringError) self.assertRaises(MissingComponentsScoringError, self.client.get_categories, u'text', u'pepe')
def test_no_classifiers(self): urllib2.urlopen= fail_response(NoClassifiersScoringError) self.assertRaises(NoClassifiersScoringError, self.client.get_categories, u'text', u'pepe')