Skip to content

Commit

Permalink
fix: evaluate expression from root (#67)
Browse files Browse the repository at this point in the history
* fix: evaluate expressions from root to support branches
* chore: vscode-pytest only use tests folder
  • Loading branch information
LeonardHd authored Feb 8, 2024
1 parent 4209b55 commit 71df272
Show file tree
Hide file tree
Showing 29 changed files with 1,046 additions and 866 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// for contributors.
{
"python.testing.pytestArgs": [
"."
"tests",
"examples",
"-vv"
],
"python.testing.cwd": "${workspaceFolder}",
Expand Down
2 changes: 2 additions & 0 deletions src/data_factory_testing_framework/functions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from data_factory_testing_framework.functions.evaluator import ExpressionEvaluator
from data_factory_testing_framework.functions.functions_repository import FunctionsRepository

__all__ = [
"FunctionsRepository",
"ExpressionEvaluator",
]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .expression_evaluator import ExpressionEvaluator

__all__ = [
"ExpressionEvaluator",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from typing import Union

from data_factory_testing_framework.exceptions.expression_evaluation_error import ExpressionEvaluationError


class ExpressionEvaluationInvalidNumberOfChildrenError(ExpressionEvaluationError):
"""Expression evaluation invalid number of children error."""

def __init__(self, required: int, actual: int) -> None:
"""Initialize expression evaluation invalid number of children error."""
super().__init__(f"Invalid number of children. Required: {required}, Actual: {actual}")


class ExpressionEvaluationInvalidChildTypeError(ExpressionEvaluationError):
"""Expression evaluation invalid child type error."""

def __init__(self, child_index: int, expected_types: Union[tuple[type], type], actual_type: type) -> None:
"""Initialize expression evaluation invalid child type error."""
super().__init__(
f"Invalid child type at index {child_index}. Expected: {expected_types}, Actual: {actual_type}"
)
Loading

0 comments on commit 71df272

Please sign in to comment.