def test_build_cmd_line_1(self): self.assertEquals([ 'java', '-jar', libs.selenium_server_path(), ], get_server().build_cmd_line()[:3])
def build_cmd_line(self): ''' Build the server options. ''' # Get the begin of the command line line = ['java', '-jar', libs.selenium_server_path(), ] # Go threw the server options for option in self.config.cardinalities.keys(): # Check if this option exists if self.config.has(option): # Get the number of arguments for this option cardinality = self.config.cardinalities.get(option) # If no argument, this is a boolean option if cardinality == 0: # Check if this option is enabled if self.config.getboolean(option): # If enabled add to command line line.append('-%s' % option) # Check if option with one argument elif cardinality == 1: # Add it line.extend(('-%s' % option, self.config.get(option))) # Option with multiple arguments else: # Add the option line.append('-%s' % option) # Parse the arguments and add them line.extend(shlex.split(self.config.get(option))) # Return the command line return line
def test_build_cmd_line_1(self): self.assertEquals(['java', '-jar', libs.selenium_server_path(), ], get_server().build_cmd_line()[:3])