コード例 #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)
コード例 #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)
コード例 #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)
コード例 #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)
コード例 #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)
コード例 #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)
コード例 #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)
コード例 #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)