def test_normal(self): rule = ''' value: prefix: 'lang="' suffix: '"' ''' value = main.extract_from_url('http://www.ebay.com/', rule) self.assertEquals('en', value)
def test_error(self): with self.assertRaises(HTTPError): main.extract_from_url('http://www.ip138.com/abc', '')