def test_uninstall_allpaths(self, tmpdir):
        '''With --all-paths uninstall should remove from all paths'''
        foo = dap_path('meta_only/foo-1.0.0.dap')
        home = tmpdir.mkdir('home')
        extra = tmpdir.mkdir('extra')

        res = run_da('pkg install ' + foo, environ=environ(extra))
        res = res.run_da('pkg uninstall foo --all-paths --force', environ=environ(home, extra))
Exemple #2
0
    def test_uninstall_allpaths(self, tmpdir):
        '''With --all-paths uninstall should remove from all paths'''
        foo = dap_path('meta_only/foo-1.0.0.dap')
        home = tmpdir.mkdir('home')
        extra = tmpdir.mkdir('extra')

        res = run_da('pkg install ' + foo, environ=environ(extra))
        res = res.run_da('pkg uninstall foo --all-paths --force',
                         environ=environ(home, extra))
    def test_uninstall_no_home(self, tmpdir):
        '''By default uninstall should remove only from DEVASSISTANT_HOME'''
        foo = dap_path('meta_only/foo-1.0.0.dap')
        home = tmpdir.mkdir('home')
        extra = tmpdir.mkdir('extra')

        res = run_da('pkg install ' + foo, environ=environ(extra))
        res = res.run_da('pkg uninstall foo --force', environ=environ(home, extra),
                         expect_error=True)
        assert 'it is not in ' + str(home) in res.stdout
    def test_install_dependency_satisfied_different_path(self, tmpdir):
        '''When foo's dependencies are satisfied by a package in a different load path,
        this requirement should be deemed satisfied'''
        foo = dap_path('meta_only/foo-1.0.0.dap')
        wantsfoo = dap_path('dependencies/wantsfoo-1.0.0.dap')
        foodir = tmpdir.mkdir('foodir')
        wantsfoodir = tmpdir.mkdir('wantsfoodir')

        res = run_da('pkg install ' + foo, environ=environ(foodir))
        res = res.run_da('pkg install ' + wantsfoo, environ=environ(wantsfoodir, foodir))
Exemple #5
0
    def test_install_dependency_satisfied_different_path(self, tmpdir):
        '''When foo's dependencies are satisfied by a package in a different load path,
        this requirement should be deemed satisfied'''
        foo = dap_path('meta_only/foo-1.0.0.dap')
        wantsfoo = dap_path('dependencies/wantsfoo-1.0.0.dap')
        foodir = tmpdir.mkdir('foodir')
        wantsfoodir = tmpdir.mkdir('wantsfoodir')

        res = run_da('pkg install ' + foo, environ=environ(foodir))
        res = res.run_da('pkg install ' + wantsfoo,
                         environ=environ(wantsfoodir, foodir))
Exemple #6
0
    def test_uninstall_no_home(self, tmpdir):
        '''By default uninstall should remove only from DEVASSISTANT_HOME'''
        foo = dap_path('meta_only/foo-1.0.0.dap')
        home = tmpdir.mkdir('home')
        extra = tmpdir.mkdir('extra')

        res = run_da('pkg install ' + foo, environ=environ(extra))
        res = res.run_da('pkg uninstall foo --force',
                         environ=environ(home, extra),
                         expect_error=True)
        assert 'it is not in ' + str(home) in res.stdout
    def test_install_twice_different_path(self, tmpdir):
        '''Installing already installed dap to different path should fail, unless --reinstall'''
        command = 'pkg install ' + dap_path('meta_only/foo-1.0.0.dap')
        home = tmpdir.mkdir('home')
        extra = tmpdir.mkdir('extra')

        res = run_da(command, environ=environ(home))

        env = environ(extra, home)
        res = res.run_da(command, environ=env, expect_error=True)

        assert 'DAP foo is already installed' in res.stdout

        res = res.run_da(command + ' --reinstall', environ=env)

        res = res.run_da('pkg list', environ=env)
        assert 'extra' in res.stdout
        assert 'home' in res.stdout
Exemple #8
0
    def test_install_twice_different_path(self, tmpdir):
        '''Installing already installed dap to different path should fail, unless --reinstall'''
        command = 'pkg install ' + dap_path('meta_only/foo-1.0.0.dap')
        home = tmpdir.mkdir('home')
        extra = tmpdir.mkdir('extra')

        res = run_da(command, environ=environ(home))

        env = environ(extra, home)
        res = res.run_da(command, environ=env, expect_error=True)

        assert 'DAP foo is already installed' in res.stdout

        res = res.run_da(command + ' --reinstall', environ=env)

        res = res.run_da('pkg list', environ=env)
        assert 'extra' in res.stdout
        assert 'home' in res.stdout
    def test_install_paths(self, tmpdir):
        '''Test where are DAPs being installed with DEVASSISTANT_NO_DEFAULT_PATH'''
        foo = dap_path('meta_only/foo-1.0.0.dap')
        home = tmpdir.mkdir('home')
        path = tmpdir.mkdir('path')
        e = environ(home, path, dont_put_home=True)

        res = run_da('pkg install ' + foo, environ=e)
        res = res.run_da('pkg list')
        assert str(path) in res.stdout
        assert not str(home) in res.stdout
Exemple #10
0
    def test_install_paths(self, tmpdir):
        '''Test where are DAPs being installed with DEVASSISTANT_NO_DEFAULT_PATH'''
        foo = dap_path('meta_only/foo-1.0.0.dap')
        home = tmpdir.mkdir('home')
        path = tmpdir.mkdir('path')
        e = environ(home, path, dont_put_home=True)

        res = run_da('pkg install ' + foo, environ=e)
        res = res.run_da('pkg list')
        assert str(path) in res.stdout
        assert not str(home) in res.stdout
    def test_update_all_paths(self, package, tmpdir):
        '''update with --all-paths in all paths'''
        foo = dap_path('meta_only/common_args-0.0.1.dap')
        foodir = tmpdir.mkdir('foodir')
        home = tmpdir.mkdir('home')

        # install old common_args to foodir
        res = run_da('pkg install ' + foo, environ=environ(foodir))

        # update with different home
        res = res.run_da('pkg update --all-paths ' + package, environ=environ(home, foodir))

        # update goes fine
        assert 'DAP common_args successfully updated' in res.stdout

        # check we have new version in foodir
        # and no version in home
        res = res.run_da('pkg list', environ=environ(home, foodir))
        assert 'common_args' in res.stdout
        assert '0.0.1' not in res.stdout
        assert str(foodir) in res.stdout
        assert str(home) not in res.stdout
    def test_update_different_path(self, package, tmpdir):
        '''update should install new version to DEVASSISTANT_HOME'''
        foo = dap_path('meta_only/common_args-0.0.1.dap')
        foodir = tmpdir.mkdir('foodir')
        home = tmpdir.mkdir('home')

        # install old common_args to foodir
        res = run_da('pkg install ' + foo, environ=environ(foodir))

        # update with different home
        res = res.run_da('pkg update ' + package, environ=environ(home, foodir))

        # update goes fine
        assert 'DAP common_args successfully updated' in res.stdout

        # check we have both versions
        res = res.run_da('pkg list', environ=environ(foodir))
        assert '0.0.1' in res.stdout

        res = res.run_da('pkg list', environ=environ(home))
        assert 'common_args' in res.stdout
        assert '0.0.1' not in res.stdout
Exemple #13
0
    def test_update_all_paths(self, package, tmpdir):
        '''update with --all-paths in all paths'''
        foo = dap_path('meta_only/common_args-0.0.1.dap')
        foodir = tmpdir.mkdir('foodir')
        home = tmpdir.mkdir('home')

        # install old common_args to foodir
        res = run_da('pkg install ' + foo, environ=environ(foodir))

        # update with different home
        res = res.run_da('pkg update --all-paths ' + package,
                         environ=environ(home, foodir))

        # update goes fine
        assert 'DAP common_args successfully updated' in res.stdout

        # check we have new version in foodir
        # and no version in home
        res = res.run_da('pkg list', environ=environ(home, foodir))
        assert 'common_args' in res.stdout
        assert '0.0.1' not in res.stdout
        assert str(foodir) in res.stdout
        assert str(home) not in res.stdout
Exemple #14
0
    def test_update_different_path(self, package, tmpdir):
        '''update should install new version to DEVASSISTANT_HOME'''
        foo = dap_path('meta_only/common_args-0.0.1.dap')
        foodir = tmpdir.mkdir('foodir')
        home = tmpdir.mkdir('home')

        # install old common_args to foodir
        res = run_da('pkg install ' + foo, environ=environ(foodir))

        # update with different home
        res = res.run_da('pkg update ' + package,
                         environ=environ(home, foodir))

        # update goes fine
        assert 'DAP common_args successfully updated' in res.stdout

        # check we have both versions
        res = res.run_da('pkg list', environ=environ(foodir))
        assert '0.0.1' in res.stdout

        res = res.run_da('pkg list', environ=environ(home))
        assert 'common_args' in res.stdout
        assert '0.0.1' not in res.stdout