Example #1
0
 def test_valid_url(self, url):
     '''test validating valid url'''
     test_obj = GoodreadsAPIClient(url=url)
     try :
         test_obj.url_validator()
     except InvalidGoodreadsURL:
         assert False
     else :
         assert True
Example #2
0
 def test_valid_xml_parser(self,url):
     '''test xml parser method with valid xml'''
     time.sleep(2)
     test_obj = GoodreadsAPIClient(url=url)
     try:
         test_obj.url_validator()
         test_obj.service_caller()
         test_obj.xml_parser()
     except InvalidGoodreadsURL:
         assert False
     except ServiceCallException:
         assert False
     else:
         self.assertIsInstance(test_obj._out, dict)
Example #3
0
 def test_invalid_url(self, url):
     '''test invalid url'''
     test_obj = GoodreadsAPIClient(url=url)
     with pytest.raises(InvalidGoodreadsURL):
         test_obj.url_validator()