mirror of
https://github.com/nvbn/thefuck.git
synced 2025-09-21 04:32:37 +01:00
#298 Simplify func tests
This commit is contained in:
@@ -18,34 +18,29 @@ RUN pip2 install -U pip setuptools
|
||||
'''))
|
||||
|
||||
|
||||
@functional
|
||||
@pytest.mark.parametrize('tag, dockerfile', containers)
|
||||
def test_with_confirmation(tag, dockerfile):
|
||||
with spawn(tag, dockerfile, u'bash') as proc:
|
||||
proc.sendline(u"export PS1='$ '")
|
||||
proc.sendline(u'eval $(thefuck-alias)')
|
||||
proc.sendline(u'touch $HISTFILE')
|
||||
with_confirmation(proc)
|
||||
history_changed(proc)
|
||||
@pytest.fixture(params=containers)
|
||||
def proc(request):
|
||||
tag, dockerfile = request.param
|
||||
proc = spawn(request, tag, dockerfile, u'bash')
|
||||
proc.sendline(u"export PS1='$ '")
|
||||
proc.sendline(u'eval $(thefuck-alias)')
|
||||
proc.sendline(u'touch $HISTFILE')
|
||||
return proc
|
||||
|
||||
|
||||
@functional
|
||||
@pytest.mark.parametrize('tag, dockerfile', containers)
|
||||
def test_refuse_with_confirmation(tag, dockerfile):
|
||||
with spawn(tag, dockerfile, u'bash') as proc:
|
||||
proc.sendline(u"export PS1='$ '")
|
||||
proc.sendline(u'eval $(thefuck-alias)')
|
||||
proc.sendline(u'touch $HISTFILE')
|
||||
refuse_with_confirmation(proc)
|
||||
history_not_changed(proc)
|
||||
def test_with_confirmation(proc):
|
||||
with_confirmation(proc)
|
||||
history_changed(proc)
|
||||
|
||||
|
||||
@functional
|
||||
@pytest.mark.parametrize('tag, dockerfile', containers)
|
||||
def test_without_confirmation(tag, dockerfile):
|
||||
with spawn(tag, dockerfile, u'bash') as proc:
|
||||
proc.sendline(u"export PS1='$ '")
|
||||
proc.sendline(u'eval $(thefuck-alias)')
|
||||
proc.sendline(u'touch $HISTFILE')
|
||||
without_confirmation(proc)
|
||||
history_changed(proc)
|
||||
def test_refuse_with_confirmation(proc):
|
||||
refuse_with_confirmation(proc)
|
||||
history_not_changed(proc)
|
||||
|
||||
|
||||
@functional
|
||||
def test_without_confirmation(proc):
|
||||
without_confirmation(proc)
|
||||
history_changed(proc)
|
||||
|
Reference in New Issue
Block a user