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)
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)
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), [])
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)
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), [])