-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d77b82f
commit 887528b
Showing
2 changed files
with
21 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import re | ||
from utils import scenarios | ||
from utils._context._scenarios import get_all_scenarios | ||
|
||
|
||
@scenarios.test_the_test | ||
def test_scenario_names(): | ||
for scenario in get_all_scenarios(): | ||
name = scenario.name | ||
assert re.fullmatch( | ||
r"^[A-Z][A-Z\d_]+$", name | ||
), f"'{name}' is not a valid name for a scenario, it should be only capital letters" | ||
|
||
expected_property = name.lower() | ||
|
||
assert hasattr(scenarios, expected_property), f"Scenarios object sould have the {expected_property} property" | ||
assert ( | ||
getattr(scenarios, expected_property) is scenario | ||
), f"scenarios.{expected_property} should be the {scenario} object" |
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