1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-09-21 12:42:31 +01:00

Move special data types to types

This commit is contained in:
nvbn
2015-04-22 23:04:22 +02:00
parent 54c408a6b5
commit d3d1f99232
17 changed files with 89 additions and 88 deletions

View File

@@ -1,15 +1,8 @@
from mock import patch, Mock
from thefuck.main import Rule
from thefuck.types import Rule
from thefuck import conf
def test_rules_names_list():
assert conf.RulesNamesList(['bash', 'lisp']) == ['bash', 'lisp']
assert conf.RulesNamesList(['bash', 'lisp']) == conf.RulesNamesList(['bash', 'lisp'])
assert Rule('lisp', None, None, False) in conf.RulesNamesList(['lisp'])
assert Rule('bash', None, None, False) not in conf.RulesNamesList(['lisp'])
def test_default():
assert Rule('test', None, None, True) in conf.DEFAULT_RULES
assert Rule('test', None, None, False) not in conf.DEFAULT_RULES
@@ -66,10 +59,3 @@ def test_settings_from_env_with_DEFAULT():
patch('thefuck.conf.os.environ', new_callable=lambda: {'THEFUCK_RULES': 'DEFAULT_RULES:bash:lisp'}):
settings = conf.get_settings(Mock())
assert settings.rules == conf.DEFAULT_RULES + ['bash', 'lisp']
def test_update_settings():
settings = conf.Settings({'key': 'val'})
new_settings = settings.update(key='new-val')
assert new_settings.key == 'new-val'
assert settings.key == 'val'