Skip to content

Commit

Permalink
fixed a validation-error for valid names, which caused server-CI to f…
Browse files Browse the repository at this point in the history
…ail (#171)

* fixed a validation-error for valid names, which caused server-CI to fail

* fixed an additional validation-error, also caused by incorrect test-input-values
  • Loading branch information
larsfroelich authored Mar 15, 2024
1 parent 130eb5d commit 3714789
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


@pytest.mark.parametrize(
"value", ["x", "x-x", "x-x-x", "x" * 64, "12345678", "example", "12345678-abc"]
"value", ["x", "x-x", "x-x-x", "x" * 64, "example"]
)
def test_validate_type_name_pass(value):
pydantic.TypeAdapter(validation.types.Name).validate_python(value)
Expand All @@ -36,14 +36,16 @@ def test_validate_type_name_pass(value):
"饭",
'"',
".;",
"12345678",
"12345678-abc",
],
)
def test_validate_type_name_fail(value):
with pytest.raises(pydantic.ValidationError):
pydantic.TypeAdapter(validation.types.Name).validate_python(value)


@pytest.mark.parametrize("value", ["x", "x_x", "x_x_x", "x" * 64, "abc", "example_abc"])
@pytest.mark.parametrize("value", ["x", "x_x", "x_x_x", "x" * 64, "abc", "example_abc", "example_123"])
def test_validate_type_key_pass(value):
pydantic.TypeAdapter(validation.types.Key).validate_python(value)

Expand All @@ -69,7 +71,7 @@ def test_validate_type_key_pass(value):
'"',
".;",
"12345678",
"example_123",
"12example_123",
],
)
def test_validate_type_key_fail(value):
Expand Down

0 comments on commit 3714789

Please sign in to comment.