mirror of
https://github.com/nvbn/thefuck.git
synced 2025-09-19 03:32:31 +01:00
Addressed Issue #210
This commit is contained in:
25
tests/rules/test_open.py
Normal file
25
tests/rules/test_open.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import pytest
|
||||
from thefuck.rules.open import match, get_new_command
|
||||
from tests.utils import Command
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command', [
|
||||
Command(script='open foo.com'),
|
||||
Command(script='open foo.ly'),
|
||||
Command(script='open foo.org'),
|
||||
Command(script='open foo.net'),
|
||||
Command(script='open foo.se'),
|
||||
Command(script='open foo.io')])
|
||||
def test_match(command):
|
||||
assert match(command, None)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('command, new_command', [
|
||||
(Command('open foo.com'), 'open http://foo.com'),
|
||||
(Command('open foo.ly'), 'open http://foo.ly'),
|
||||
(Command('open foo.org'), 'open http://foo.org'),
|
||||
(Command('open foo.net'), 'open http://foo.net'),
|
||||
(Command('open foo.se'), 'open http://foo.se'),
|
||||
(Command('open foo.io'), 'open http://foo.io')])
|
||||
def test_get_new_command(command, new_command):
|
||||
assert get_new_command(command, None) == new_command
|
Reference in New Issue
Block a user