From 284d49da8d0ab3252b5426423b608033d39c2669 Mon Sep 17 00:00:00 2001 From: Vladimir Iakovlev Date: Fri, 23 Feb 2018 21:15:05 +0100 Subject: [PATCH] #786: Fix tests --- tests/rules/test_apt_get.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/rules/test_apt_get.py b/tests/rules/test_apt_get.py index 57a441a2..acedc7e1 100644 --- a/tests/rules/test_apt_get.py +++ b/tests/rules/test_apt_get.py @@ -12,9 +12,8 @@ from thefuck.types 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', - create=True) - mock.getPackages.return_value = packages + mocker.patch('thefuck.rules.apt_get._get_packages', + create=True, return_value=packages) assert match(command) @@ -30,9 +29,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', - create=True) - mock.getPackages.return_value = packages + mocker.patch('thefuck.rules.apt_get._get_packages', + create=True, return_value=packages) assert not match(command) @@ -49,7 +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', - create=True) - mock.getPackages.return_value = packages + mocker.patch('thefuck.rules.apt_get._get_packages', + create=True, return_value=packages) + assert get_new_command(command) == new_command