Skip to content

Commit

Permalink
Add test to verify global config file path
Browse files Browse the repository at this point in the history
  • Loading branch information
deveshks committed Jun 7, 2020
1 parent 47c85f7 commit 84d6719
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/functional/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,15 @@ def test_site_values(self, script, virtualenv):
assert "global.timeout: 60" in result.stdout
assert "freeze.timeout: 10" in result.stdout
assert re.search(r"site:\n( .+\n)+", result.stdout)

def test_global_config_file(self, script):
"""Test that the system-wide configuration can be identified"""

# We cannot write to system-wide files which might have permissions
# defined in a way that the tox virtualenvcannot write to those
# locations. Additionally we cannot patch those paths since pip config
# commands runs inside a subprocess.
# So we just check if the file can be identified
global_config_file = get_configuration_files()[kinds.GLOBAL][0]
result = script.pip("config", "debug")
assert "{}, exists:".format(global_config_file) in result.stdout

0 comments on commit 84d6719

Please sign in to comment.