예제 #1
0
def test_curd_package():
    "It should possible to convert regular packages to wheels"

    # Given that I have a storage containing a package
    index = Index(FIXTURE('storage1'))
    index.scan()

    # And a curdling using that index
    curdling = Curdler(**{'index': index})

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

    # Then I see it's a wheel package.
    package['wheel'].should.match(
        FIXTURE('storage1/gherkin-0.1.0-py\d{2}-none-any.whl'))

    # And that it's present in the index
    package = index.get('gherkin==0.1.0;whl')

    # And that the file was created in the file system
    os.path.exists(package).should.be.true

    # And I delete the file
    os.unlink(package)
예제 #2
0
def test_curd_package():
    "It should possible to convert regular packages to wheels"

    # Given that I have a storage containing a package
    index = Index(FIXTURE('storage1'))
    index.scan()

    # And a curdling using that index
    curdling = Curdling(index=index)

    # When I request a curd to be created
    package = curdling.wheel('gherkin==0.1.0', ('main', {
        'path': index.get('gherkin==0.1.0;~whl')}))

    # Then I see it's a wheel package.
    package.should.equal({
        'path': FIXTURE('storage1/gherkin-0.1.0-py27-none-any.whl'),
    })

    # And that it's present in the index
    package = index.get('gherkin==0.1.0;whl')

    # And that the file was created in the file system
    os.path.exists(package).should.be.true

    # And I delete the file
    os.unlink(package)
예제 #3
0
def test_curd_package():
    "It should possible to convert regular packages to wheels"

    # Given that I have a storage containing a package
    index = Index(FIXTURE('storage1'))
    index.scan()

    # And a curdling using that index
    curdling = Curdler(**{'index': index})

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

    # Then I see it's a wheel package.
    package['wheel'].should.match(
        FIXTURE('storage1/gherkin-0.1.0-py\d{2}-none-any.whl'))

    # And that it's present in the index
    package = index.get('gherkin==0.1.0;whl')

    # And that the file was created in the file system
    os.path.exists(package).should.be.true

    # And I delete the file
    os.unlink(package)
예제 #4
0
def test_curd_package():
    "It should possible to convert regular packages to wheels"

    # Given that I have a storage containing a package
    index = Index(FIXTURE('storage1'))
    index.scan()

    # And a curdling using that index
    curdling = Curdling(index=index)

    # When I request a curd to be created
    package = curdling.wheel('gherkin==0.1.0',
                             ('main', {
                                 'path': index.get('gherkin==0.1.0;~whl')
                             }))

    # Then I see it's a wheel package.
    package.should.equal({
        'path':
        FIXTURE('storage1/gherkin-0.1.0-py27-none-any.whl'),
    })

    # And that it's present in the index
    package = index.get('gherkin==0.1.0;whl')

    # And that the file was created in the file system
    os.path.exists(package).should.be.true

    # And I delete the file
    os.unlink(package)
예제 #5
0
def test_index_scan_when_there_is_no_dir():
    "Index.scan() should not fail when the dir does not exist"

    # Given that I have an index that points to a directory that already
    # contains packages
    index = Index('I know this directory does not exist')

    # When I scan the directory, I see it does not fail
    index.scan()
예제 #6
0
def test_index_scan():
    "It should be possible to scan for already existing folders"

    # Given that I have an index that points to a folder that already contains
    # packages
    index = Index(FIXTURE('storage1'))

    # When I scan the directory
    index.scan()

    # Then I can look for packages
    index.get('gherkin==0.1.0').should.equal(
        FIXTURE('storage1/gherkin-0.1.0.tar.gz'), )
예제 #7
0
def test_index_scan():
    "It should be possible to scan for already existing folders"

    # Given that I have an index that points to a folder that already contains
    # packages
    index = Index(FIXTURE('storage1'))

    # When I scan the directory
    index.scan()

    # Then I can look for packages
    index.get('gherkin==0.1.0').should.equal(
        FIXTURE('storage1/gherkin-0.1.0.tar.gz'),
    )
예제 #8
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")
예제 #9
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.install('gherkin==0.1.0', ('main', {
        'path': index.get('gherkin==0.1.0;whl')}))

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

    # And I uninstall the package
    Env({}).uninstall('gherkin==0.1.0')
예제 #10
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')
예제 #11
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.install('gherkin==0.1.0',
                      ('main', {
                          'path': index.get('gherkin==0.1.0;whl')
                      }))

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

    # And I uninstall the package
    Env({}).uninstall('gherkin==0.1.0')
예제 #12
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')