本文整理汇总了Python中up2date_client.rpcServer.getServer函数的典型用法代码示例。如果您正苦于以下问题:Python getServer函数的具体用法?Python getServer怎么用?Python getServer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getServer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testDefaultWelcomeMessageHttpToHttpCheckReturnCode
def testDefaultWelcomeMessageHttpToHttpCheckReturnCode(self):
"Test redirecting http to http and verify its return code"
self.cfg['serverURL'] = "http://SECRET_URL/XMLRPC-REDIRECT-NOSSL"
s = rpcServer.getServer()
s.registration.welcome_message()
status = s.get_response_status()
self.assertEqual(status, 200)
示例2: testGetServerRedirectServer
def testGetServerRedirectServer(self):
"Verify that getServer works when talking to a server that redirects"
self.cfg['serverURL'] = "%s-REDIRECT" % self.cfg['serverURL']
try:
s = rpcServer.getServer()
except:
self.fail("Got an expection calling rpcServer.getServer")
示例3: testGetServerRedirectServer
def testGetServerRedirectServer(self):
"Verify that getServer works when talking to a server that redirects"
self.cfg['serverURL'] = "https://rhn.redhat.com/XMLRPC-REDIRECT"
try:
s = rpcServer.getServer()
except:
self.fail("Got an expection calling rpcServer.getServer")
示例4: testDefaulWelcomeMessageNoRedirectCheckRedirect
def testDefaulWelcomeMessageNoRedirectCheckRedirect(self):
"Test a non redirecting connection and see if redirected() is set"
self.cfg['serverURL'] = "http://SECRET_URL/XMLRPC"
s = rpcServer.getServer()
s.registration.welcome_message()
ret = s.redirected()
self.assertEqual(ret, None)
示例5: testDefaultWelcomeMessageHttpToHttpsCheckRedirect
def testDefaultWelcomeMessageHttpToHttpsCheckRedirect(self):
"Test redirecting http to https and verify redirect()"
self.cfg['serverURL'] = "%s/XMLRPC-REDIRECT" % self.defaultServer
s = rpcServer.getServer()
s.registration.welcome_message()
ret = s.redirected()
self.assertEqual(ret, "%s/XMLRPC") % self.defaultServer
示例6: testDefaultWelcomeMessageHttpsToHttpsCheckReturnCode
def testDefaultWelcomeMessageHttpsToHttpsCheckReturnCode(self):
"Test redirecting https to https and verify its return code"
self.cfg['serverURL'] = "%s/XMLRPC-REDIRECT" % self.defaultServer
s = rpcServer.getServer()
s.registration.welcome_message()
status = s.get_response_status()
self.assertEqual(status, 200)
示例7: __init__
def __init__(self, serverOverride=None, timeout=None, rpcServerOverride=None):
if rpcServerOverride is None:
self._server = rpcServer.getServer(serverOverride=serverOverride,
timeout=timeout)
else:
self._server = rpcServerOverride
self._capabilities = None
示例8: testDefaultWelcomeMessageHttpToHttpCheckRedirect
def testDefaultWelcomeMessageHttpToHttpCheckRedirect(self):
"Test redirecting http to http and verify redirect()"
self.cfg['serverURL'] = "http://SECRET_URL/XMLRPC-REDIRECT-NOSSL"
s = rpcServer.getServer()
s.registration.welcome_message()
ret = s.redirected()
self.assertEqual(ret, "http://SECRET_URL/XMLRPC")
示例9: updateHardware
def updateHardware():
s = rpcServer.getServer()
hardwareList = hardware.Hardware()
s.registration.refresh_hw_profile(up2dateAuth.getSystemId(),
hardwareList)
示例10: testGetServerMultipleCaCert
def testGetServerMultipleCaCert(self):
"getServer with a multiple CA certs"
rpcServer.rhns_ca_certs = ["/usr/share/rhn/RHNS-CA-CERT", "/usr/share/rhn/RHNS-CA-CERT"]
try:
s = rpcServer.getServer()
except:
self.fail("Got an %s expection" % sys.exc_type)
示例11: testGetServerAuthProxyNoEnableAuthProxy
def testGetServerAuthProxyNoEnableAuthProxy(self):
"getServer with httpProxy set, but no enableAuthProxy"
sys.path.append("/etc/sysconfig/rhn/")
proxyUrl = testConfig.authProxyUrl
self.cfg['httpProxy'] = testConfig.authProxyUrl
try:
s = rpcServer.getServer()
except:
self.fail("Got an expection calling rpcServer.getServer")
示例12: testGetServerProxy
def testGetServerProxy(self):
"Verify that getServer Works when specifying a proxy"
sys.path.append("/etc/sysconfig/rhn/")
proxyUrl = testConfig.anonProxyUrl
self.cfg['httpProxy'] = proxyUrl
try:
s = rpcServer.getServer()
except:
self.fail("Got an expection calling rpcServer.getServer")
示例13: testDefaultWelcomeMessageHttpsToHttp
def testDefaultWelcomeMessageHttpsToHttp(self):
"Test redirecting https to http"
self.cfg['serverURL'] = "https://SECRET_URL/XMLRPC-REDIRECT-NOSSL"
s = rpcServer.getServer()
try:
s.registration.welcome_message()
except rpclib.InvalidRedirectionError:
pass
else:
self.fail("IOError expected here but didnt get it")
示例14: testGetServerNoCaCert
def testGetServerNoCaCert(self):
"getServer with a missing CA cert"
self.cfg['sslCACert'] = ["/var/not/likely/to/exist/I/hope/SSL-CA-Cert"]
try:
s = rpcServer.getServer()
write(s)
except SystemExit:
pass
else:
self.fail("Expected to get an SSLCertificateFileNotFound error")
示例15: testGetServerAuthProxyNoUsername
def testGetServerAuthProxyNoUsername(self):
"Verify that getSerer works when specifying an an auth proxy and no username"
sys.path.append("/etc/sysconfig/rhn/")
proxyUrl = testConfig.authProxyUrl
self.cfg['httpProxy'] = testConfig.authProxyUrl
self.cfg['enableAuthProxy'] = 1
try:
s = rpcServer.getServer()
except:
self.fail("Got an expection calling rpcServer.getServer")