def test_create_mst_rep_inst(self): """Function: test_create_mst_rep_inst Description: Test with MasterRep class instance. Arguments: """ srv = mysql_libs.create_instance(self.config_name, self.config_dir, mysql_class.MasterRep) self.assertTrue(isinstance(srv, mysql_class.MasterRep))
def test_create_server_inst(self): """Function: test_create_server_inst Description: Test with Server class instance. Arguments: """ srv = mysql_libs.create_instance(self.config_name, self.config_dir, mysql_class.Server) self.assertTrue(isinstance(srv, mysql_class.Server))
def test_rep_user(self): """Function: test_rep_user Description: Test with passing rep_user information. Arguments: """ srv = mysql_libs.create_instance(self.config_name, self.config_dir, mysql_class.SlaveRep) self.assertEqual(srv.rep_user, self.rep_user)
def test_create_instance(self): """Function: test_create_instance Description: Test create_instance function. Arguments: """ srv = mysql_libs.create_instance(self.config_name, self.config_dir, mysql_class.SlaveRep) self.assertTrue(isinstance(srv, mysql_class.SlaveRep))
def test_create_instance(self, mock_cfg): """Function: test_create_instance Description: Test create_instance function. Arguments: """ mock_cfg.return_value = self.cfg srv_inst = mysql_libs.create_instance("Cfgfile", "DirPath", Server) self.assertTrue(isinstance(srv_inst, Server))
def test_none_rep_user(self, mock_cfg): """Function: test_none_rep_user Description: Test with none for rep_user. Arguments: """ mock_cfg.return_value = self.cfg srv_inst = mysql_libs.create_instance("Cfgfile", "DirPath", Server) self.assertTrue(isinstance(srv_inst, Server))
def test_none_rep_user2(self, mock_cfg): """Function: test_none_rep_user2 Description: Test with none for rep_user. Arguments: """ mock_cfg.return_value = self.cfg srv_inst = mysql_libs.create_instance("Cfgfile", "DirPath", Server) self.assertEqual(srv_inst.__dict__.get("rep_user", None), None)
def test_none_extra_def_file(self, mock_cfg): """Function: test_none_extra_def_file Description: Test with none for extra_def_file. Arguments: """ mock_cfg.return_value = self.cfg self.cfg.extra_def_file = None srv_inst = mysql_libs.create_instance("Cfgfile", "DirPath", Server) self.assertTrue(isinstance(srv_inst, Server))