def test_no_gem(mock_method): mock_method.return_value = False try: installer = GemInstaller() installer.get_install_command(['whatever']) assert False, "should have raised" except InstallFailed: pass
def test_no_gem(mock_method): mock_method.return_value = False try: installer = GemInstaller() installer.get_install_command(["whatever"]) assert False, "should have raised" except InstallFailed: pass
def test(mock_method, mock_is_gem_installed): mock_is_gem_installed.return_value = True installer = GemInstaller() mock_method.return_value = [] assert [] == installer.get_install_command(["fake"]) # no interactive option with GEM mock_method.return_value = ["a", "b"] expected = [["sudo", "gem", "install", "a"], ["sudo", "gem", "install", "b"]] val = installer.get_install_command(["whatever"], interactive=False) assert val == expected, val expected = [["sudo", "gem", "install", "a"], ["sudo", "gem", "install", "b"]] val = installer.get_install_command(["whatever"], interactive=True) assert val == expected, val
def test(mock_method, mock_is_gem_installed): mock_is_gem_installed.return_value = True installer = GemInstaller() mock_method.return_value = [] assert [] == installer.get_install_command(['fake']) # no interactive option with GEM mock_method.return_value = ['a', 'b'] expected = [['sudo', 'gem', 'install', 'a'], ['sudo', 'gem', 'install', 'b']] val = installer.get_install_command(['whatever'], interactive=False) assert val == expected, val expected = [['sudo', 'gem', 'install', 'a'], ['sudo', 'gem', 'install', 'b']] val = installer.get_install_command(['whatever'], interactive=True) assert val == expected, val
def test_GemInstaller_get_depends(): # make sure GemInstaller supports depends from xylem.platforms.gem import GemInstaller installer = GemInstaller() assert ['foo'] == installer.get_depends(dict(depends=['foo']))
def test_GemInstaller_get_depends(): # make sure GemInstaller supports depends from xylem.platforms.gem import GemInstaller installer = GemInstaller() assert ["foo"] == installer.get_depends(dict(depends=["foo"]))