def __init__(self, device): self.logger = logging.getLogger('Plugin.wrapper.HTTP') url = device.pluginProps['url'] self.device = device self.client = clients.HttpClient(url)
def test_Http500(self): client = clients.HttpClient('https://httpstat.us/500') available = client.isAvailable() self.assertFalse(available)
def test_Http301(self): client = clients.HttpClient('https://httpstat.us/301') available = client.isAvailable() # the python client should process the redirect to a "success" status self.assertTrue(available)