Skip to content

Commit 6bff0e8

Browse files
committed
cleanups + docco
1 parent a7a0ba6 commit 6bff0e8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tests/validator.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,29 @@
1313
os.chdir("..")
1414
import pytest
1515
import asfyaml
16+
import repository
17+
18+
# Rewire the notifications path, so we can test with a mock json file
1619
import feature.notifications
1720
feature.notifications.VALID_LISTS_FILE = "tests/mailinglists.json"
18-
import repository
21+
22+
# Set .asf.yaml to debug mode
1923
asfyaml.DEBUG = True
2024

2125

2226
@pytest.mark.validator
2327
def test_basic_yaml():
24-
EXPECTED_ENVS = {"production", "dev"} # We expect these two envs enabled
25-
EXPECTED_FEATURES_MIN = {"test"}
28+
expected_envs = {"production", "dev"} # We expect these two envs enabled
29+
expected_minimum_features = {"test"}
2630
basic_yaml = open("tests/basic-dev-env.yaml", "r").read()
2731
testrepo = repository.Repository("/x1/gitbox/repos/private/whimsy/whimsy-private.git")
2832
a = asfyaml.ASFYamlInstance(testrepo, "humbedooh", basic_yaml)
2933
a.run_parts()
3034

3135
# We should have both prod+dev envs enabled here
32-
assert a.environments_enabled == EXPECTED_ENVS
36+
assert a.environments_enabled == expected_envs
3337
# We should have at least our 'test' feature in the set
34-
assert EXPECTED_FEATURES_MIN.issubset(a.enabled_features.keys())
38+
assert expected_minimum_features.issubset(a.enabled_features.keys())
3539

3640
# The repo should be marked as private by asfyaml
3741
assert testrepo.is_private is True, "Expected testrepo.private to be True, but wasn't!"

0 commit comments

Comments
 (0)