Beispiel #1
0
 def test_xmlrpc_permission(self):
     # Test returned response if not XML_RPC permission
     rpc_testenv._tracadmin('permission', 'remove', 'anonymous',
                             'XML_RPC', wait=True)
     e = self.assertRaises(xmlrpclib.Fault,
                 self.anon.system.listMethods)
     self.assertEquals(403, e.faultCode)
     self.assertTrue('XML_RPC' in e.faultString)
     rpc_testenv._tracadmin('permission', 'add', 'anonymous',
                                     'XML_RPC', wait=True)
Beispiel #2
0
 def test_xmlrpc_permission(self):
     # Test returned response if not XML_RPC permission
     rpc_testenv._tracadmin("permission", "remove", "anonymous", "XML_RPC", wait=True)
     try:
         result = self._anon_req({"method": "system.listMethods", "id": "no-perm"})
         self.assertEquals(None, result["result"])
         self.assertEquals("no-perm", result["id"])
         self.assertEquals(403, result["error"]["code"])
         self.assertTrue("XML_RPC" in result["error"]["message"])
     finally:
         # Add back the default permission for further tests
         rpc_testenv._tracadmin("permission", "add", "anonymous", "XML_RPC", wait=True)
Beispiel #3
0
 def test_xmlrpc_permission(self):
     # Test returned response if not XML_RPC permission
     rpc_testenv._tracadmin('permission', 'remove', 'anonymous',
                             'XML_RPC', wait=True)
     try:
         result = self._anon_req({'method': 'system.listMethods',
                                  'id': 'no-perm'})
         self.assertEquals(None, result['result'])
         self.assertEquals('no-perm', result['id'])
         self.assertEquals(403, result['error']['code'])
         self.assertTrue('XML_RPC' in result['error']['message'])
     finally:
         # Add back the default permission for further tests
         rpc_testenv._tracadmin('permission', 'add', 'anonymous',
                                     'XML_RPC', wait=True)
Beispiel #4
0
 def test_xmlrpc_permission(self):
     # Test returned response if not XML_RPC permission
     rpc_testenv._tracadmin('permission',
                            'remove',
                            'anonymous',
                            'XML_RPC',
                            wait=True)
     try:
         result = self._anon_req({
             'method': 'system.listMethods',
             'id': 'no-perm'
         })
         self.assertEquals(None, result['result'])
         self.assertEquals('no-perm', result['id'])
         self.assertEquals(403, result['error']['code'])
         self.assertTrue('XML_RPC' in result['error']['message'])
     finally:
         # Add back the default permission for further tests
         rpc_testenv._tracadmin('permission',
                                'add',
                                'anonymous',
                                'XML_RPC',
                                wait=True)