Exemplo n.º 1
0
 def test_context_manager(self):
     with xmlrpclib.ServerProxy(URL) as server:
         server.add(2, 3)
         self.assertNotEqual(server('transport')._connection,
                             (None, None))
     self.assertEqual(server('transport')._connection,
                      (None, None))
Exemplo n.º 2
0
 def test_context_manager_method_error(self):
     try:
         with xmlrpclib.ServerProxy(URL) as server:
             server.add(2, "a")
     except xmlrpclib.Fault:
         pass
     self.assertEqual(server('transport')._connection, (None, None))
 def test_context_manager(self):
     with xmlrpclib.ServerProxy(URL) as server:
         server.add(2, 3)
         self.assertNotEqual(server('transport')._connection,
                             (None, None))
     self.assertEqual(server('transport')._connection,
                      (None, None))
Exemplo n.º 4
0
 def test_context_manager_method_error(self):
     try:
         with xmlrpclib.ServerProxy(URL) as server:
             server.add(2, "a")
     except xmlrpclib.Fault:
         pass
     self.assertEqual(server('transport')._connection,
                      (None, None))
Exemplo n.º 5
0
 def test_unicode_host(self):
     server = xmlrpclib.ServerProxy("http://%s:%d/RPC2" % (ADDR, PORT))
     self.assertEqual(server.add("a", "\xe9"), "a\xe9")
Exemplo n.º 6
0
 def test_unicode_host(self):
     server = xmlrpclib.ServerProxy("http://%s:%d/RPC2" % (ADDR, PORT))
     self.assertEqual(server.add("a", "\xe9"), "a\xe9")
Exemplo n.º 7
0
 def test_unicode_host(self):
     server = xmlrpclib.ServerProxy('http://%s:%d/RPC2' % (ADDR, PORT))
     self.assertEqual(server.add('a', 'é'), 'aé')