Example #1
0
 def test_service_caller_200OK(self, url):
     '''test service caller method'''
     time.sleep(2)
     test_obj = GoodreadsAPIClient(url=url)
     try :
         test_obj.service_caller()
     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_service_caller_NOTOK(self, url):
     '''test service caller method'''
     time.sleep(2)
     test_obj = GoodreadsAPIClient(url=url)
     with pytest.raises(ServiceCallException):
         test_obj.service_caller()