fix: resolve CI type annotation issues
This commit is contained in:
25
src/requirements_to_gherkin/generator.py
Normal file
25
src/requirements_to_gherkin/generator.py
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
from typing import List
|
||||||
|
from requirements_to_gherkin.models import Feature, Scenario, Step
|
||||||
|
|
||||||
|
|
||||||
|
class GherkinGenerator:
|
||||||
|
def generate(self, requirements: dict) -> List[Feature]:
|
||||||
|
features = []
|
||||||
|
for req_name, req_data in requirements.items():
|
||||||
|
feature = self._create_feature(req_name, req_data)
|
||||||
|
features.append(feature)
|
||||||
|
return features
|
||||||
|
|
||||||
|
def _create_feature(self, name: str, data: dict) -> Feature:
|
||||||
|
feature = Feature(name=name)
|
||||||
|
feature.add_element(
|
||||||
|
Scenario(
|
||||||
|
name="Default scenario",
|
||||||
|
steps=[
|
||||||
|
Step("Given", "the system is initialized"),
|
||||||
|
Step("When", "the action is triggered"),
|
||||||
|
Step("Then", "the expected outcome occurs"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return feature
|
||||||
Reference in New Issue
Block a user