Coverage for src/kwai/core/template/template_engine.py: 100%
4 statements
« prev ^ index » next coverage.py v7.6.10, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.6.10, created at 2024-01-01 00:00 +0000
1"""Module that defines an interface for a template engine."""
3from abc import abstractmethod
5from .template import Template
8class TemplateNotFoundException(Exception):
9 """Raised when a template cannot be found."""
12class TemplateEngine:
13 """Interface for a template engine."""
15 @abstractmethod
16 def create(self, template_file_path: str) -> Template:
17 """Create a template from the given file path.
19 When the template cannot be found, a TemplateNotFoundException should be raised.
20 """
21 raise NotImplementedError