예제 #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
예제 #2
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
예제 #3
0
파일: test_main.py 프로젝트: qrees/curdling
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")
예제 #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')
예제 #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')