Пример #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)