def test_is_add_cmd_empty(self): """Function: test_is_add_cmd_empty Description: Test with empty dictionary. Arguments: """ self.mongo.config["ssl"] = False cmd_line = mongo_libs.create_cmd( self.mongo, self.args_array, self.prog_name, self.path_opt, opt_arg={}) self.assertEqual(cmd_line, self.cmd_result)
def test_add_cmd(self): """Function: test_add_cmd Description: Test with add_cmd call. Arguments: """ self.mongo.config["ssl"] = False cmd_line = mongo_libs.create_cmd( self.mongo, self.args_array, self.prog_name, self.path_opt, req_arg=self.req_arg) self.assertEqual(cmd_line, self.cmd_result2)
def test_crt_base_cmd2(self): """Function: test_crt_base_cmd2 Description: Test with combinations. Arguments: """ self.mongo.config["ssl"] = False cmd_line = mongo_libs.create_cmd( self.mongo, self.args_array3, self.prog_name, self.path_opt, req_arg=self.req_arg, opt_arg=self.opt_arg2) self.assertEqual(cmd_line, self.cmd_result8)
def test_is_add_cmd_dict(self): """Function: test_is_add_cmd_dict Description: Test with multiple dictionary. Arguments: """ self.mongo.config["ssl"] = False cmd_line = mongo_libs.create_cmd( self.mongo, self.args_array3, self.prog_name, self.path_opt, opt_arg=self.opt_arg2) self.assertEqual(cmd_line, self.cmd_result6)
def test_full_test(self): """Function: test_full_test Description: Test with all external calls. Arguments: """ self.mongo.config["ssl"] = False cmd_line = mongo_libs.create_cmd( self.mongo, self.args_array3, self.prog_name, self.path_opt, req_arg=self.req_arg2, opt_arg=self.opt_arg2) self.assertEqual(cmd_line, self.cmd_result9)
def test_full_test(self): """Function: test_full_test Description: Test with all external calls. Arguments: """ self.assertEqual( mongo_libs.create_cmd(self.mongo, self.args_array, self.prog_name, self.path_opt, opt_arg=self.opt_arg, req_arg=self.req_arg), self.result3)
def test_is_add_cmd(self, mock_arg, mock_cmd): """Function: test_is_add_cmd Description: Test with is_add_cmd call. Arguments: """ mock_arg.return_value = self.path + "/" mock_cmd.return_value = [self.path + "/" + self.prog_name] self.assertEqual( mongo_libs.create_cmd(self.mongo, self.args_array, self.prog_name, self.path_opt, opt_arg=self.opt_arg), self.result)
def test_crt_base_cmd(self, mock_arg): """Function: test_crt_base_cmd Description: Test with crt_base_cmd call. Arguments: """ mock_arg.return_value = self.path + "/" self.assertEqual( mongo_libs.create_cmd(self.mongo, self.args_array, self.prog_name, self.path_opt, opt_arg=self.opt_arg, req_arg=self.req_arg), self.result3)
def test_default(self, mock_arg, mock_cmd, mock_add, mock_is_add): """Function: test_default Description: Test with default settings. Arguments: """ mock_arg.return_value = "Base_Program" mock_cmd.return_value = "Base_Crt_Program" mock_add.return_value = "Base_Crt_Program_Arg" mock_is_add.return_value = ["Base_Crt_Program_Arg_Plus"] self.assertEqual( mongo_libs.create_cmd(self.mongo, self.args_array, self.prog_name, self.path_opt, req_arg=self.req_arg), ["Base_Crt_Program_Arg_Plus"])