Coverage for src / ezcompiler / adapters / base_file_writer.py: 100.00%

4 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-03-27 06:49 +0000

1# /////////////////////////////////////////////////////////////// 

2# BASE_FILE_WRITER - Abstract file writer port 

3# Project: ezcompiler 

4# /////////////////////////////////////////////////////////////// 

5 

6"""Abstract file writer port for template output operations.""" 

7 

8from __future__ import annotations 

9 

10# /////////////////////////////////////////////////////////////// 

11# IMPORTS 

12# /////////////////////////////////////////////////////////////// 

13# Standard library imports 

14from abc import ABC, abstractmethod 

15from pathlib import Path 

16 

17# /////////////////////////////////////////////////////////////// 

18# CLASSES 

19# /////////////////////////////////////////////////////////////// 

20 

21 

22class BaseFileWriter(ABC): 

23 """Port for writing text content to a target file path.""" 

24 

25 @abstractmethod 

26 def write_text( 

27 self, 

28 output_path: Path, 

29 content: str, 

30 encoding: str = "utf-8", 

31 ) -> None: 

32 """Write text content to output_path."""