mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-19 12:24:29 +00:00
15 lines
494 B
Python
15 lines
494 B
Python
from mock import Mock
|
|
from thefuck.rules.cp_omitting_directory import match, get_new_command
|
|
|
|
|
|
def test_match():
|
|
assert match(Mock(script='cp dir', stderr="cp: omitting directory 'dir'"),
|
|
None)
|
|
assert not match(Mock(script='some dir',
|
|
stderr="cp: omitting directory 'dir'"), None)
|
|
assert not match(Mock(script='cp dir', stderr=""), None)
|
|
|
|
|
|
def test_get_new_command():
|
|
assert get_new_command(Mock(script='cp dir'), None) == 'cp -a dir'
|