-
Notifications
You must be signed in to change notification settings - Fork 993
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the fix to add missing project length validation.
Addressing the issue - #4626
- Loading branch information
1 parent
8e0c1b5
commit 85f8895
Showing
3 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
sdk/python/tests/unit/sdk/python/feast/test_repo_operations_validate_feast_project_name.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from sdk.python.feast.repo_operations import is_valid_name | ||
|
||
|
||
def test_is_valid_name(): | ||
test_cases = [ | ||
# Valid project name cases | ||
("valid_name1", True), | ||
("username_1234", True), | ||
("valid123", True), | ||
("1234567890123456", True), | ||
("invalid_name_", True), | ||
|
||
# Invalid project name cases | ||
("_invalidName", False), | ||
("invalid-Name", False), | ||
("too_long_name_123", False), | ||
("invalid name", False), | ||
("invalid@name", False), | ||
("invalid$name", False), | ||
("__", False), | ||
("12345678901234567", False), | ||
] | ||
|
||
for name, expected in test_cases: | ||
assert is_valid_name(name) == expected, f"Failed for project invalid name: {name}" |