Пример #1
0
    def test_multilist_two_val(self):

        """Function:  test_multilist_one_val

        Description:  Test with multi_list set to two values.

        Arguments:

        """

        self.assertEqual(arg_parser._parse_multi(self.argv, {}, {}),
                         (["file2"], {"-f": ["file1", "file2"]}))
Пример #2
0
    def test_multilist_two_args(self):

        """Function:  test_multilist_two_args

        Description:  Test with multi_list set to one arg and one other arg.

        Arguments:

        """

        self.argv = ["-f", "file1", "file2", "-M"]

        self.assertEqual(arg_parser._parse_multi(self.argv, {}, {}),
                         (["file2", "-M"], {"-f": ["file1", "file2"]}))
Пример #3
0
    def test_multilist_one_arg(self, mock_int):
        """Function:  test_multilist_one_arg

        Description:  Test with multi_list set to one argument.

        Arguments:

        """

        mock_int.return_value = False

        argv, args_array = arg_parser._parse_multi(self.argv, {}, {})
        self.assertEqual((argv, args_array), (["file2"], {
            "-f": ["file1", "file2"]
        }))
Пример #4
0
    def test_multilist_def_arg(self):

        """Function:  test_multilist_def_arg

        Description:  Test with multi_list set to one arg using default.

        Arguments:

        """

        self.argv = ["-g"]

        self.assertEqual(arg_parser._parse_multi(self.argv, {},
                                                 self.opt_def_dict),
                         (["-g"], self.opt_def_dict))
Пример #5
0
    def test_multilist_def_arg(self, mock_int, mock_def):
        """Function:  test_multilist_def_arg

        Description:  Test with multi_list set to one arg using default.

        Arguments:

        """

        mock_int.return_value = False
        mock_def.return_value = self.opt_def_dict

        self.argv = ["-g"]

        self.assertEqual(
            arg_parser._parse_multi(self.argv, {}, self.opt_def_dict),
            (["-g"], self.opt_def_dict))
Пример #6
0
    def test_multilist_one_val(self, mock_int):
        """Function:  test_multilist_one_val

        Description:  Test with multi_list set to one value.

        Arguments:

        """

        mock_int.return_value = False

        self.argv = ["-f", "file1"]

        self.assertEqual(arg_parser._parse_multi(self.argv, {}, {}),
                         (["file1"], {
                             "-f": ["file1"]
                         }))
Пример #7
0
    def test_multilist_two_args(self, mock_int):
        """Function:  test_multilist_two_args

        Description:  Test with multi_list set to one arg and one other arg.

        Arguments:

        """

        mock_int.return_value = False

        self.argv = ["-f", "file1", "file2", "-M"]

        argv, args_array = arg_parser._parse_multi(self.argv, {}, {})
        self.assertEqual((argv, args_array), (["file2", "-M"], {
            "-f": ["file1", "file2"]
        }))