1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-09-19 03:32:31 +01:00

Add ability to change settings via environment variables

This commit is contained in:
nvbn
2015-04-22 20:18:53 +02:00
parent b4b599df80
commit 69a9516477
8 changed files with 233 additions and 61 deletions

View File

@@ -1,6 +1,15 @@
from mock import Mock
from thefuck.utils import sudo_support
from thefuck.utils import sudo_support, wrap_settings
from thefuck.main import Command
from thefuck.conf import BaseSettings
def test_wrap_settings():
fn = lambda _, settings: settings._conf
assert wrap_settings({'key': 'val'})(fn)(None, BaseSettings({})) \
== {'key': 'val'}
assert wrap_settings({'key': 'new-val'})(fn)(
None, BaseSettings({'key': 'val'})) == {'key': 'new-val'}
def test_sudo_support():