Ejemplo n.º 1
0
def test_imr_no_attribute(mock_ws):
    """
    Should not bother looking up what's installed when there's no requirements.
    """
    module = object()
    server.install_missing_requirements(module)
    mock_ws.assert_not_called()
Ejemplo n.º 2
0
def test_imr_no_attribute(mock_ws):
    """
    Should not bother looking up what's installed when there's no requirements.
    """
    module = object()
    server.install_missing_requirements(module)
    mock_ws.assert_not_called()
Ejemplo n.º 3
0
def test_imr_bad_pkg_fails(mock_find):
    """
    Should raise exception when pkg installation fails.
    """
    module = mock.Mock()
    module.REQUIREMENTS = [str(uuid.uuid4())]
    with pytest.raises(server.CannotInstallModuleRequirements):
        server.install_missing_requirements(module)
Ejemplo n.º 4
0
def test_imr_blank_list(mock_ws):
    """
    Should not bother looking up what's installed when there's no requirements.
    """
    module = mock.Mock()
    module.REQUIREMENTS = []
    server.install_missing_requirements(module)
    mock_ws.assert_not_called()
Ejemplo n.º 5
0
def test_imr_bad_pkg_fails(mock_find):
    """
    Should raise exception when pkg installation fails.
    """
    module = mock.Mock()
    module.REQUIREMENTS = [str(uuid.uuid4())]
    with pytest.raises(server.CannotInstallModuleRequirements):
        server.install_missing_requirements(module)
Ejemplo n.º 6
0
def test_imr_blank_list(mock_ws):
    """
    Should not bother looking up what's installed when there's no requirements.
    """
    module = mock.Mock()
    module.REQUIREMENTS = []
    server.install_missing_requirements(module)
    mock_ws.assert_not_called()
Ejemplo n.º 7
0
def test_imr_has_requirements(mock_pip, mock_find):
    """
    Should install all missing args.
    """
    module = mock.Mock()
    module.REQUIREMENTS = ["testreq1", "testreq2==1.2.3"]
    server.install_missing_requirements(module)
    args, _ = mock_pip.call_args
    assert args == (["testreq1", "testreq2==1.2.3"],)
Ejemplo n.º 8
0
def test_imr_has_requirements(mock_pip, mock_find):
    """
    Should install all missing args.
    """
    module = mock.Mock()
    module.REQUIREMENTS = ["testreq1", "testreq2==1.2.3"]
    server.install_missing_requirements(module)
    args, _ = mock_pip.call_args
    assert args == (["testreq1", "testreq2==1.2.3"], )