Skip to content

Commit 5fe5dd2

Browse files
committed
@sanderegg review: whitespaces test
1 parent c062f50 commit 5fe5dd2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

services/web/server/tests/unit/isolated/test_products_model.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,14 @@ def test_product_to_static():
8181
def test_product_host_regex_with_spaces():
8282
data = Product.Config.schema_extra["examples"][2]
8383

84-
data["support_email"] = " [email protected] " # with leading and trailing spaces and
84+
# with leading and trailing spaces and uppercase (tests anystr_strip_whitespace )
85+
data["support_email"] = " [email protected] "
8586

87+
# with leading trailing spaces (tests validator("host_regex", pre=True))
8688
expected = r"([\.-]{0,1}osparc[\.-])".strip()
87-
data["host_regex"] = expected + " " # with leading trailing spaces
89+
data["host_regex"] = expected + " "
8890

91+
# parsing should strip all whitespaces and normalize email
8992
product = Product.parse_obj(data)
9093

9194
assert product.host_regex.pattern == expected

0 commit comments

Comments
 (0)