Exemple #1
0
def test_check_installed(DistributionPath):
    "It should be possible to check if a certain package is currently installed"

    DistributionPath.return_value.get_distribution.return_value = Mock()
    Database.check_installed('gherkin==0.1.0').should.be.true

    DistributionPath.return_value.get_distribution.return_value = None
    Database.check_installed('gherkin==0.1.0').should.be.false
def test_check_installed(DistributionPath):
    "It should be possible to check if a certain package is currently installed"

    DistributionPath.return_value.get_distribution.return_value = Mock()
    Database.check_installed("gherkin==0.1.0").should.be.true

    DistributionPath.return_value.get_distribution.return_value = None
    Database.check_installed("gherkin==0.1.0").should.be.false
Exemple #3
0
def test_install_package():
    "It should possible to install wheels"

    # Given that I have an installer configured with a loaded index
    index = Index(FIXTURE("storage2"))
    index.scan()
    installer = Installer(**{"index": index})

    # When I request a curd to be created
    installer.handle("main", {"requirement": "gherkin==0.1.0", "wheel": index.get("gherkin==0.1.0;whl")})

    # Then I see that the package was installed
    Database.check_installed("gherkin==0.1.0").should.be.true

    # And I uninstall the package
    Database.uninstall("gherkin==0.1.0")
Exemple #4
0
def test_install_package():
    "It should possible to install wheels"

    # Given that I have an installer configured with a loaded index
    index = Index(FIXTURE('storage2'))
    index.scan()
    installer = Installer(**{'index': index})

    # When I request a curd to be created
    installer.handle('main', {
        'requirement': 'gherkin==0.1.0',
        'wheel': index.get('gherkin==0.1.0;whl'),
    })

    # Then I see that the package was installed
    Database.check_installed('gherkin==0.1.0').should.be.true

    # And I uninstall the package
    Database.uninstall('gherkin==0.1.0')
Exemple #5
0
def test_install_package():
    "It should possible to install wheels"

    # Given that I have an installer configured with a loaded index
    index = Index(FIXTURE('storage2'))
    index.scan()
    installer = Installer(**{'index': index})

    # When I request a curd to be created
    installer.handle(
        'main', {
            'requirement': 'gherkin==0.1.0',
            'wheel': index.get('gherkin==0.1.0;whl'),
        })

    # Then I see that the package was installed
    Database.check_installed('gherkin==0.1.0').should.be.true

    # And I uninstall the package
    Database.uninstall('gherkin==0.1.0')