示例#1
0
    def test_set_db_list(self, mock_list):
        """Function:  test_set_db_list

        Description:  Test with only default arguments passed.

        Arguments:

        """

        mock_list.return_value = self.db_list

        self.assertEqual(
            mysql_db_dump.set_db_list(self.server, self.args_array),
            self.results)
示例#2
0
    def test_d_option(self, mock_list):
        """Function:  test_d_option

        Description:  Test with the -D option.

        Arguments:

        """

        mock_list.return_value = self.db_list

        self.assertEqual(
            mysql_db_dump.set_db_list(self.server, self.args_array2),
            self.results)
示例#3
0
    def test_b_option_all(self, mock_list):
        """Function:  test_b_option_all

        Description:  Test with the -B option with all databases.

        Arguments:

        """

        mock_list.return_value = self.db_list

        self.db_list.sort()
        results = mysql_db_dump.set_db_list(self.server, self.args_array4)
        results.sort()
        self.assertEqual(results, self.db_list)
示例#4
0
    def test_a_option(self, mock_list):
        """Function:  test_a_option

        Description:  Test with the -A option.

        Arguments:

        """

        mock_list.return_value = self.db_list

        self.db_list.sort()
        results = mysql_db_dump.set_db_list(self.server, self.args_array3)
        results.sort()
        self.assertEqual(results, self.db_list)
示例#5
0
    def test_b_option_none(self, mock_list):
        """Function:  test_b_option_none

        Description:  Test with the -B option with no databases.

        Arguments:

        """

        mock_list.return_value = self.db_list

        with gen_libs.no_std_out():
            results = mysql_db_dump.set_db_list(self.server, self.args_array7)

        results.sort()
        self.assertEqual(results, self.results)