Sha256: ae61679ffff933b2152b8d82af4e11677029fed55bc447a0f56800a044e1dc09

Contents?: true

Size: 1.18 KB

Versions: 88

Compression:

Stored size: 1.18 KB

Contents

$LOAD_PATH.unshift File.expand_path('../lib', File.dirname(__FILE__))
require 'test/unit'
require 'autoproj'
require 'flexmock/test_unit'

class TC_OSDependencies_Pip < Test::Unit::TestCase
    include Autoproj

    attr_reader :pip_manager

    def setup
        Autoproj::OSDependencies.operating_system = [['test', 'debian', 'default'], ['v1.0', 'v1', 'default']]

        @pip_manager = PackageManagers::PipManager.new
        Autobuild.programs['pip'] = 'mypip'
        super
    end

    def teardown
        super
        Autobuild.programs['pip'] = nil
    end

    def test_install_packages
        subprocess = flexmock(Autobuild::Subprocess)

        packages = ['pkg0', 'pkg1', 'pkg2']
        subprocess.should_receive(:run).
            with(any, any, 'mypip', 'install', '--user', 'pkg0', 'pkg1','pkg2').once
        pip_manager.install(packages)
    end

    def test_install_packaes_disabled_and_not_silent
        subprocess = flexmock(Autobuild::Subprocess)

        pip_manager.enabled = false
        pip_manager.silent = false
        subprocess.should_receive(:run).never
        flexmock(STDIN).should_receive(:readline).once.and_return
        pip_manager.install([['pkg0']])
    end
end

Version data entries

88 entries across 88 versions & 1 rubygems

Version Path
autoproj-1.13.7 test/package_managers/test_pip.rb
autoproj-1.13.6 test/package_managers/test_pip.rb
autoproj-1.13.5 test/package_managers/test_pip.rb
autoproj-1.13.5.rc1 test/package_managers/test_pip.rb
autoproj-1.13.4 test/package_managers/test_pip.rb
autoproj-1.13.3 test/package_managers/test_pip.rb
autoproj-1.13.3.b2 test/package_managers/test_pip.rb
autoproj-1.13.3.b1 test/package_managers/test_pip.rb
autoproj-1.13.2.b4 test/package_managers/test_pip.rb
autoproj-1.13.2.b3 test/package_managers/test_pip.rb
autoproj-1.13.2.b2 test/package_managers/test_pip.rb
autoproj-1.13.2.b1 test/package_managers/test_pip.rb
autoproj-2.0.0.b7 test/package_managers/test_pip.rb
autoproj-2.0.0.b6 test/package_managers/test_pip.rb
autoproj-2.0.0.b5 test/package_managers/test_pip.rb
autoproj-2.0.0.b4 test/package_managers/test_pip.rb
autoproj-2.0.0.b3 test/package_managers/test_pip.rb
autoproj-2.0.0.b2 test/package_managers/test_pip.rb
autoproj-2.0.0.b1 test/package_managers/test_pip.rb
autoproj-1.13.2 test/package_managers/test_pip.rb