def is_valid_name(self): # type: () -> bool if not is_v2_file(self.current_file): return True else: name = self.current_file.get('name') correct_name = "V2" if not name.endswith(correct_name): print_error(Errors.invalid_v2_script_name(self.file_path)) return False return True
def is_valid_display_name(self): # type: () -> bool if not is_v2_file(self.current_file): return True else: display_name = self.current_file.get('display') correct_name = " v2" if not display_name.endswith(correct_name): print_error(Errors.invalid_v2_integration_name(self.file_path)) return False return True
def is_valid_display_name(self): # type: () -> bool if not is_v2_file(self.current_file): return True else: display_name = self.current_file.get('display') correct_name = " v2" if not display_name.endswith(correct_name): error_message, error_code = Errors.invalid_v2_integration_name() if self.handle_error(error_message, error_code, file_path=self.file_path): return False return True
def is_valid_name(self): # type: () -> bool if not is_v2_file(self.current_file): return True else: name = self.current_file.get('name') correct_name = "V2" if not name.endswith(correct_name): error_message, error_code = Errors.invalid_v2_script_name() if self.handle_error(error_message, error_code, file_path=self.file_path): return False return True
def test_is_v2_file(current, answer): assert is_v2_file(current) is answer