2015-04-25 02:54:39 +02:00
|
|
|
import pytest
|
2019-11-01 02:41:07 +02:00
|
|
|
from thefuck.rules.rm_root import match
|
2017-08-31 17:58:56 +02:00
|
|
|
from thefuck.types import Command
|
2015-04-22 16:22:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_match():
|
2019-10-25 00:51:47 +03:00
|
|
|
assert match(Command('rm -rf /', ''))
|
2015-04-25 02:54:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize('command', [
|
2017-08-31 17:58:56 +02:00
|
|
|
Command('ls', 'add --no-preserve-root'),
|
2019-10-25 00:51:47 +03:00
|
|
|
Command('rm', '/usr/bin/python')])
|
2015-04-25 02:54:39 +02:00
|
|
|
def test_not_match(command):
|
2015-09-07 13:00:29 +03:00
|
|
|
assert not match(command)
|