Ejemplo n.º 1
0
 def __request(self, request):
     # call a method on the remote server
     
     response = self.__transport.request(request)
     logger.debug('got response from __transport :: %s' % response)
     if type(response) is not int:
         return json.loads(response)
     else:
         logger.error('Recieved status code %s' % response)
Ejemplo n.º 2
0
    def __request(self, request):
        # call a method on the remote server

        response = self.__transport.request(request)
        logger.debug('got response from __transport :: %s' % response)
        if type(response) is not int:
            return json.loads(response)
        else:
            logger.error('Recieved status code %s' % response)
Ejemplo n.º 3
0
 def __call__(self):
     from windmill.bin import shell_objects
     client = shell_objects.xmlrpc_client
     self.do_test = getattr(client, self.do_test)
     self.do_command = getattr(client, self.do_command)
     client.start_suite(self.name)
     for line in self.lines:
         if json.loads(line)['method'].find('command') is -1:
             result = self.do_test(line)
             if not self.debugging:  
                 assert result['result']
         else:
             result = self.do_command(line)
             if not self.debugging:  
                 assert result
Ejemplo n.º 4
0
 def __call__(self):
     from windmill.bin import shell_objects
     client = shell_objects.xmlrpc_client
     self.do_test = getattr(client, self.do_test)
     self.do_command = getattr(client, self.do_command)
     client.start_suite(self.name)
     for line in self.lines:
         if json.loads(line)['method'].find('command') is -1:
             result = self.do_test(line)
             if not self.debugging:
                 assert result['result']
         else:
             result = self.do_command(line)
             if not self.debugging:
                 assert result
Ejemplo n.º 5
0
 def run_json_tests(self, tests):
     """Run list of json tests"""
     return self.run_tests([json.loads(test) for test in tests])
Ejemplo n.º 6
0
 def execute_json_test(self, json):
     """Add test from json object with 'method' and 'params' defined, block until it returns, return the result"""
     action_object = json.loads(json)
     return self.execute_object(self._queue.add_test, self._test_resolution_suite, action_object)
Ejemplo n.º 7
0
 def add_json_command(self, json):
     """Add command from json object with 'method' and 'params' defined"""
     action_object = json.loads(json)
     self.add_object(self._queue.add_command, action_object)
     return 200
Ejemplo n.º 8
0
 def add_json_test(self, json, suite_name=None):
     """Add test from json object with 'method' and 'params' defined"""
     action_object = json.loads(json)
     self.add_object(self._queue.add_test, action_object, suite_name)
     return 200
Ejemplo n.º 9
0
def transform_json_to_python(json_strings):
    """Transform serialized JSON objects to python code using the windmill transformer architecture"""
    tests = []
    for line in json_strings:
        tests.append(json.loads(line))
    return transforms.build_test_file(tests)
Ejemplo n.º 10
0
def transform_json_to_python(json_strings):
    """Transform serialized JSON objects to python code using the windmill transformer architecture"""
    tests = []
    for line in json_strings:
        tests.append(json.loads(line))
    return transforms.build_test_file(tests)
Ejemplo n.º 11
0
 def _decode(self, s):
     """Internal method for decoding json objects, uses simplejson"""
     return json.loads(s)
Ejemplo n.º 12
0
 def run_json_tests(self, tests):
     """Run list of json tests"""
     return self.run_tests([json.loads(test) for test in tests])
Ejemplo n.º 13
0
 def execute_json_test(self, json):
     """Add test from json object with 'method' and 'params' defined, block until it returns, return the result"""
     action_object = json.loads(json)
     return self.execute_object(self._queue.add_test,
                                self._test_resolution_suite, action_object)
Ejemplo n.º 14
0
 def add_json_command(self, json):
     """Add command from json object with 'method' and 'params' defined"""
     action_object = json.loads(json)
     self.add_object(self._queue.add_command, action_object)
     return 200
Ejemplo n.º 15
0
 def add_json_test(self, json, suite_name=None):
     """Add test from json object with 'method' and 'params' defined"""
     action_object = json.loads(json)
     self.add_object(self._queue.add_test, action_object, suite_name)
     return 200