File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 13
13
os .chdir (".." )
14
14
import pytest
15
15
import asfyaml
16
+ import repository
17
+
18
+ # Rewire the notifications path, so we can test with a mock json file
16
19
import feature .notifications
17
20
feature .notifications .VALID_LISTS_FILE = "tests/mailinglists.json"
18
- import repository
21
+
22
+ # Set .asf.yaml to debug mode
19
23
asfyaml .DEBUG = True
20
24
21
25
22
26
@pytest .mark .validator
23
27
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" }
26
30
basic_yaml = open ("tests/basic-dev-env.yaml" , "r" ).read ()
27
31
testrepo = repository .Repository ("/x1/gitbox/repos/private/whimsy/whimsy-private.git" )
28
32
a = asfyaml .ASFYamlInstance (testrepo , "humbedooh" , basic_yaml )
29
33
a .run_parts ()
30
34
31
35
# We should have both prod+dev envs enabled here
32
- assert a .environments_enabled == EXPECTED_ENVS
36
+ assert a .environments_enabled == expected_envs
33
37
# 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 ())
35
39
36
40
# The repo should be marked as private by asfyaml
37
41
assert testrepo .is_private is True , "Expected testrepo.private to be True, but wasn't!"
You can’t perform that action at this time.
0 commit comments