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

Don't mess with inheritance for filling settings

This commit is contained in:
nvbn
2015-04-22 22:29:23 +02:00
parent 69a9516477
commit 0553d57ec1
4 changed files with 74 additions and 70 deletions

View File

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