示例#1
0
 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
示例#2
0
 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
示例#3
0
    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
示例#4
0
    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
示例#5
0
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']))
示例#6
0
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"]))