Skip to content
Snippets Groups Projects
Commit 08eca31e authored by Ellis Percival's avatar Ellis Percival
Browse files

Fix tests

parent 9fd50e75
Branches
Tags
No related merge requests found
...@@ -2,7 +2,6 @@ import uuid ...@@ -2,7 +2,6 @@ import uuid
import mock import mock
import pytest import pytest
from pip.status_codes import SUCCESS
from pi_mqtt_gpio import server from pi_mqtt_gpio import server
...@@ -29,16 +28,16 @@ def test_imr_blank_list(mock_ws): ...@@ -29,16 +28,16 @@ def test_imr_blank_list(mock_ws):
@mock.patch("pkg_resources.WorkingSet.find", return_value=None) @mock.patch("pkg_resources.WorkingSet.find", return_value=None)
@mock.patch("pip.commands.install.InstallCommand.main", return_value=SUCCESS) @mock.patch("subprocess.check_call")
def test_imr_has_requirements(mock_pip, mock_find): def test_imr_has_requirements(mock_check_call, mock_find):
""" """
Should install all missing args. Should install all missing args.
""" """
module = mock.Mock() module = mock.Mock()
module.REQUIREMENTS = ["testreq1", "testreq2==1.2.3"] module.REQUIREMENTS = ["testreq1", "testreq2==1.2.3"]
server.install_missing_requirements(module) server.install_missing_requirements(module)
args, _ = mock_pip.call_args args, _ = mock_check_call.call_args
assert args == (["testreq1", "testreq2==1.2.3"],) assert args == (["/usr/bin/env", "pip", "install", "testreq1", "testreq2==1.2.3"],)
@mock.patch("pkg_resources.WorkingSet.find", return_value=None) @mock.patch("pkg_resources.WorkingSet.find", return_value=None)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment