Exemplo n.º 1
0
 def testProxyEnabled(self):
     up2date_cfg = {}
     up2date_cfg['enableProxy'] = True
     up2date_cfg['enableProxyAuth'] = False
     up2date_cfg['httpProxy'] = 'foobar.com:40'
     url = rhnplugin.get_proxy_url(up2date_cfg)
     self.assertNotEquals(None, url)
Exemplo n.º 2
0
 def testProxyEnabled(self):
     up2date_cfg = {}
     up2date_cfg['enableProxy'] = True
     up2date_cfg['enableProxyAuth'] = False
     up2date_cfg['httpProxy'] = 'foobar.com:40'
     url = rhnplugin.get_proxy_url(up2date_cfg)
     self.assertNotEquals(None, url)
Exemplo n.º 3
0
 def testProxyNoAuth(self):
     up2date_cfg = {}
     up2date_cfg['enableProxy'] = True
     up2date_cfg['enableProxyAuth'] = False
     netloc = 'foobar.com:40'
     up2date_cfg['httpProxy'] = netloc
     expected_proxy = 'https://' + netloc
     url = rhnplugin.get_proxy_url(up2date_cfg)
     self.assertEquals(expected_proxy, url)
Exemplo n.º 4
0
 def testProxyNoAuth(self):
     up2date_cfg = {}
     up2date_cfg['enableProxy'] = True
     up2date_cfg['enableProxyAuth'] = False
     netloc = 'foobar.com:40'
     up2date_cfg['httpProxy'] = netloc
     expected_proxy = 'https://' + netloc
     url = rhnplugin.get_proxy_url(up2date_cfg)
     self.assertEquals(expected_proxy, url)
Exemplo n.º 5
0
    def testProxyAuthEnabled(self):
        up2date_cfg = {}
        up2date_cfg['enableProxy'] = True
        netloc = 'foobar.com:40'
        up2date_cfg['httpProxy'] = netloc
        up2date_cfg['enableProxyAuth'] = True

        user = '******'
        password = '******'
        up2date_cfg['proxyUser'] = user
        up2date_cfg['proxyPassword'] = password

        expected_proxy = 'https://' + user + ":" + password + '@' + netloc
        url = rhnplugin.get_proxy_url(up2date_cfg)
        self.assertEquals(expected_proxy, url)
Exemplo n.º 6
0
    def testProxyAuthEnabled(self):
        up2date_cfg = {}
        up2date_cfg['enableProxy'] = True
        netloc = 'foobar.com:40'
        up2date_cfg['httpProxy'] = netloc
        up2date_cfg['enableProxyAuth'] = True

        user = '******'
        password = '******'
        up2date_cfg['proxyUser'] = user
        up2date_cfg['proxyPassword'] = password

        expected_proxy = 'https://' + user + ":" + password + '@' + netloc
        url = rhnplugin.get_proxy_url(up2date_cfg)
        self.assertEquals(expected_proxy, url)
Exemplo n.º 7
0
 def testProxyDisabled(self):
     up2date_cfg = {}
     up2date_cfg['enableProxy'] = False
     up2date_cfg['enableProxyAuth'] = False
     url = rhnplugin.get_proxy_url(up2date_cfg)
     self.assertEquals(None, url)
Exemplo n.º 8
0
 def testProxyDisabled(self):
     up2date_cfg = {}
     up2date_cfg['enableProxy'] = False
     up2date_cfg['enableProxyAuth'] = False
     url = rhnplugin.get_proxy_url(up2date_cfg)
     self.assertEquals(None, url)