Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8393727
test_config.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
837 B
Subscribers
None
test_config.py
View Options
# Copyright (C) 2022 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
import
pytest
from
swh.web.config
import
get_config
,
is_feature_enabled
@pytest.mark.parametrize
(
"feature_name"
,
[
"inexistant-feature"
,
"awesome-stuff"
],
)
def
test_is_feature_enabled
(
feature_name
):
config
=
get_config
()
# by default, feature non configured are considered disabled
assert
is_feature_enabled
(
feature_name
)
is
False
for
enabled
in
[
True
,
False
]:
# Let's configure the feature
config
[
"features"
]
=
{
feature_name
:
enabled
}
# and check its configuration is properly read
assert
is_feature_enabled
(
feature_name
)
is
enabled
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Wed, Jun 4, 7:16 PM (1 w, 20 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3239378
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment