示例#1
0
    def __init__(self, device):
        self.logger = logging.getLogger('Plugin.wrapper.HTTP')

        url = device.pluginProps['url']

        self.device = device
        self.client = clients.HttpClient(url)
示例#2
0
 def test_Http500(self):
     client = clients.HttpClient('https://httpstat.us/500')
     available = client.isAvailable()
     self.assertFalse(available)
示例#3
0
    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)