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)
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)
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)
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)
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()
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'), )
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'), )
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")
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')
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')
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')
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')