Skip to content

Commit

Permalink
UPDATE TO: guardrails-ai >= v0.5.4
Browse files Browse the repository at this point in the history
* REQUIRE: guardrails-ai >= 0.5.4
* FIX: Import for ValidationError
  NOTE: Was moved from guardrails.guard to guardrails.errors .
  • Loading branch information
jenisys committed Aug 14, 2024
1 parent 7d99bec commit 1e2c52a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ guardrails.cucumber-expression-match

| Developed by | jenisys |
|---------------------|----------------|
| Date of development | 2024-06-22 |
| Date of development | 2024-08-14 |
| Validator type | rule-following |
| License | MIT |
| Input/Output | Output |
Expand Down Expand Up @@ -43,7 +43,7 @@ Check if text follows a specified schema (described by this cucumber-expression)

* Dependencies:

- `guardrails-ai>=0.4.5`
- `guardrails-ai>=0.5.4`
- `cucumber-expressions>=17.1.0`
- `rstr>=3.2.2`

Expand Down
2 changes: 1 addition & 1 deletion cucumber_expression_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class CucumberExpressionMatch(Validator):
## Requirements
* Dependencies:
- guardrails-ai>=0.4.5
- guardrails-ai>=0.5.0
- cucumber-expressions>=17.1.0
- rstr>=3.2.2
Expand Down
2 changes: 1 addition & 1 deletion py.requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ============================================================================
# MAYBE: vale -- https://vale.sh/docs/topics/config/

guardrails-ai >= 0.4.5
guardrails-ai >= 0.5.4
cucumber-expressions
rstr

Expand Down
13 changes: 3 additions & 10 deletions tests/test_validator.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
from cucumber_expression_match import CucumberExpressionMatch
from cucumber_expression_match import ParameterType
from guardrails import Guard, OnFailAction
from guardrails.validator_base import (
PassResult,
FailResult,
ValidationResult
)
from guardrails.guard import (
ValidationOutcome,
ValidationError
)
from guardrails.errors import ValidationError
from guardrails.guard import ValidationOutcome
from guardrails.validator_base import PassResult, FailResult
import pytest


Expand Down Expand Up @@ -88,6 +82,5 @@ def test_parse_on_failure(self, bad_text, reason):
)
with pytest.raises(ValidationError) as exc_info:
_result = guard.parse(bad_text)

expected = f"Validation failed for field with errors: Result must match: {self.EXPRESSION}"
assert str(exc_info.value) == expected

0 comments on commit 1e2c52a

Please # to comment.