Helper function to easily exclude ROOT6 work-arounds for testing.
>>> os.environ['ROOT6_WORK_AROUND'] = 'all'
>>> ROOT6WorkAroundEnabled()
True
>>> os.environ['ROOT6_WORK_AROUND'] = 'none'
>>> ROOT6WorkAroundEnabled('JIRA-XYZ')
False
>>> os.environ['ROOT6_WORK_AROUND'] = 'JIRA-X'
>>> ROOT6WorkAroundEnabled('JIRA-X')
True
>>> ROOT6WorkAroundEnabled('JIRA-Y')
True
>>> os.environ['ROOT6_WORK_AROUND'] = 'JIRA-X,-JIRA-Y'
>>> ROOT6WorkAroundEnabled('JIRA-X')
True
>>> ROOT6WorkAroundEnabled('JIRA-Y')
False
>>> os.environ['ROOT6_WORK_AROUND'] = '-JIRA-Y'
>>> ROOT6WorkAroundEnabled('JIRA-X')
True
>>> ROOT6WorkAroundEnabled('JIRA-Y')
False
Definition at line 14 of file __init__.py.
16 Helper function to easily exclude ROOT6 work-arounds for testing.
18 >>> os.environ['ROOT6_WORK_AROUND'] = 'all'
19 >>> ROOT6WorkAroundEnabled()
21 >>> os.environ['ROOT6_WORK_AROUND'] = 'none'
22 >>> ROOT6WorkAroundEnabled('JIRA-XYZ')
24 >>> os.environ['ROOT6_WORK_AROUND'] = 'JIRA-X'
25 >>> ROOT6WorkAroundEnabled('JIRA-X')
27 >>> ROOT6WorkAroundEnabled('JIRA-Y')
29 >>> os.environ['ROOT6_WORK_AROUND'] = 'JIRA-X,-JIRA-Y'
30 >>> ROOT6WorkAroundEnabled('JIRA-X')
32 >>> ROOT6WorkAroundEnabled('JIRA-Y')
34 >>> os.environ['ROOT6_WORK_AROUND'] = '-JIRA-Y'
35 >>> ROOT6WorkAroundEnabled('JIRA-X')
37 >>> ROOT6WorkAroundEnabled('JIRA-Y')
40 enabled = os.environ.get(
"ROOT6_WORK_AROUND",
"all").lower()
43 if enabled
in (
"none",
"no",
"off",
"false",
"0"):
47 enabled = set(
map(str.strip, enabled.split(
",")))
48 disabled = set([e[1:]
for e
in enabled
if e.startswith(
"-")])
51 return id
in enabled
or id
not in disabled