def test_lang_module_true(self, mock_lib): """Function: test_lang_module_true Description: Test if lang_module check returns True. Arguments: """ mock_lib.chk_crt_file.side_effect = [(True, None), (True, None)] status_flag, err_msg = rmq_metadata._validate_files( self.cfg, self.status, self.msg) self.assertEqual((status_flag, err_msg), (True, ""))
def test_stanford_jar_path_true(self, mock_lib): """Function: test_stanford_jar_path_true Description: Test if stanford_jar path check is True. Arguments: """ mock_lib.chk_crt_file.side_effect = [(True, None), (True, None)] status_flag, err_msg = rmq_metadata._validate_files( self.cfg, self.status, self.msg) self.assertEqual((status_flag, err_msg), (True, ""))
def test_stanford_jar_false(self, mock_lib): """Function: test_stanford_jar_false Description: Test if stanford_jar check returns False. Arguments: """ mock_lib.chk_crt_file.side_effect = [(False, self.err_msg6), (True, None)] status_flag, err_msg = rmq_metadata._validate_files( self.cfg, self.status, self.msg) self.assertEqual((status_flag, err_msg), (False, self.err_msg6))
def test_lang_module_path_false(self, mock_lib): """Function: test_lang_module_path_false Description: Test if lang_module path check is False. Arguments: """ self.cfg.lang_module = "./path/Stanford_lang_module" msg = "lang_module not set to absolute path: %s" % \ (self.cfg.lang_module) mock_lib.chk_crt_file.side_effect = [(True, None), (True, None)] status_flag, err_msg = rmq_metadata._validate_files( self.cfg, self.status, self.msg) self.assertEqual((status_flag, err_msg), (False, msg))
def test_stanford_jar_path_false2(self, mock_lib): """Function: test_stanford_jar_path_false2 Description: Test stanford_jar path check is False. Arguments: """ self.cfg.stanford_jar = "./path/Stanford.jar" msg = "stanford_jar not set to absolute path: %s" % \ (self.cfg.stanford_jar) mock_lib.chk_crt_file.side_effect = [(True, None), (False, self.err_msg6)] status_flag, err_msg = rmq_metadata._validate_files( self.cfg, self.status, self.msg) self.assertEqual((status_flag, err_msg), (False, msg))