def is_valid_display_name(self): # type: () -> bool if not is_v2_file(self.current_file, check_in_display=True): return True else: display_name = self.current_file.get('display') correct_name = " v2" if not display_name.endswith(correct_name): # type: ignore 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): # type: ignore 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_via_display(current, answer): assert is_v2_file(current, check_in_display=True) is answer
def test_is_v2_file_via_name(current, answer): assert is_v2_file(current) is answer