Exemplo n.º 1
0
    def test_default(self, mock_fetch):
        """Function:  test_fetch_db_list

        Description:  Test with default arguments only.

        Arguments:

        """

        mock_fetch.return_value = self.databases

        self.assertEqual(mysql_rep_cmp.fetch_db_list(self.server), self.dblist)
Exemplo n.º 2
0
    def test_do_db_exist(self):
        """Function:  test_do_db_exist

        Description:  Test with do_db attribute exists in class.

        Arguments:

        """

        self.server.do_db = self.dblist

        self.assertEqual(mysql_rep_cmp.fetch_db_list(self.server), self.dblist)
Exemplo n.º 3
0
    def test_db_name_pass(self):
        """Function:  test_db_name_pass

        Description:  Test with db_name passed to function - no matches.

        Arguments:

        """

        self.server.do_db = self.dblist

        self.assertEqual(
            mysql_rep_cmp.fetch_db_list(self.server, db_name=self.dolist), [])
Exemplo n.º 4
0
    def test_ign_db_list_pass(self):
        """Function:  test_ign_db_list_pass

        Description:  Test with ign_db_list passed to function.

        Arguments:

        """

        self.server.do_db = self.dblist

        self.assertEqual(
            mysql_rep_cmp.fetch_db_list(self.server, ign_db_list=self.ignlist),
            self.dblist2)
Exemplo n.º 5
0
    def test_db_name_ign_db_list(self):
        """Function:  test_db_name_ign_db_list

        Description:  Test with db_name and ign_db_list args.

        Arguments:

        """

        self.server.do_db = self.dblist

        self.assertEqual(
            mysql_rep_cmp.fetch_db_list(self.server,
                                        db_name=self.dolist2,
                                        ign_db_list=self.ignlist), [])