diff --git a/tests/rules/test_apt_get.py b/tests/rules/test_apt_get.py index 37ffe3f0..1226e522 100644 --- a/tests/rules/test_apt_get.py +++ b/tests/rules/test_apt_get.py @@ -10,7 +10,8 @@ from tests.utils import Command [('vim', 'main'), ('vim-tiny', 'main')])]) def test_match(mocker, command, packages): mocker.patch('thefuck.rules.apt_get.which', return_value=None) - mock = mocker.patch('thefuck.rules.apt_get.command_not_found') + mock = mocker.patch('thefuck.rules.apt_get.command_not_found', + create=True) mock.getPackages.return_value = packages assert match(command) @@ -27,7 +28,8 @@ def test_match(mocker, command, packages): ['vim'], '/usr/bin/vim')]) def test_not_match(mocker, command, packages, which): mocker.patch('thefuck.rules.apt_get.which', return_value=which) - mock = mocker.patch('thefuck.rules.apt_get.command_not_found') + mock = mocker.patch('thefuck.rules.apt_get.command_not_found', + create=True) mock.getPackages.return_value = packages assert not match(command) @@ -45,6 +47,7 @@ def test_not_match(mocker, command, packages, which): [('imagemagick', 'main'), ('graphicsmagick-imagemagick-compat', 'universe')])]) def test_get_new_command(mocker, command, new_command, packages): - mock = mocker.patch('thefuck.rules.apt_get.command_not_found') + mock = mocker.patch('thefuck.rules.apt_get.command_not_found', + create=True) mock.getPackages.return_value = packages assert get_new_command(command) == new_command