コード例 #1
0
def proxyMethodHandler(self, kw):
    """Dummy proxyMethodHandler"""
    # login as super user
    newSecurityManager(self, self.getPortalObject().acl_users.getUserById(ERP5Security.SUPER_USER))
    data = getattr(self, kw["method_id"])(**kw["method_kw"])
    response = GeneratorCall(data=data)
    return response.dump()
コード例 #2
0
def proxyMethodHandler(self, kw):
    """Dummy proxyMethodHandler"""
    # login as super user
    newSecurityManager(
        self,
        self.getPortalObject().acl_users.getUserById(SUPER_USER))
    data = getattr(self, kw['method_id'])(**kw['method_kw'])
    response = GeneratorCall(data=data)
    return response.dump()
コード例 #3
0
ファイル: testGeneratorCall.py プロジェクト: MarkTang/erp5
  def test_dump_load(self):
    call = GeneratorCall(data='Foo')
    self.assertEqual(call['data'], 'Foo')
    dumped = call.dump()
    self.assertTrue(isinstance(dumped, str))

    # reread it in a new call
    read = GeneratorCall()
    read.load(dumped)
    self.assertEqual(read['data'], 'Foo')
コード例 #4
0
ファイル: testGeneratorCall.py プロジェクト: MarkTang/erp5
  def test_dump(self):
    call = GeneratorCall()
    dumped = call.dump()
    self.assertTrue(isinstance(dumped, str))
    load = xmlrpclib.loads(dumped)
    self.assertTrue(isinstance(load, tuple))
    self.assertEqual(len(load), 2)
    self.assertEqual(load[1], 'GeneratorAnswer')

    self.assertTrue(isinstance(load[0], tuple))
    self.assertEqual(len(load[0]), 1)
    server_response_dict = load[0][0]
    self.assertTrue(isinstance(server_response_dict, dict))
コード例 #5
0
    def test_dump(self):
        call = GeneratorCall()
        dumped = call.dump()
        self.assertTrue(isinstance(dumped, str))
        load = xmlrpclib.loads(dumped)
        self.assertTrue(isinstance(load, tuple))
        self.assertEqual(len(load), 2)
        self.assertEqual(load[1], 'GeneratorAnswer')

        self.assertTrue(isinstance(load[0], tuple))
        self.assertEqual(len(load[0]), 1)
        server_response_dict = load[0][0]
        self.assertTrue(isinstance(server_response_dict, dict))
コード例 #6
0
    def test_dump_load(self):
        call = GeneratorCall(data='Foo')
        self.assertEqual(call['data'], 'Foo')
        dumped = call.dump()
        self.assertTrue(isinstance(dumped, str))

        # reread it in a new call
        read = GeneratorCall()
        read.load(dumped)
        self.assertEqual(read['data'], 'Foo')