Exemplo n.º 1
0
def test_read_basic_fields():
    "Wheel.from_file() Should parse a `.whl` archive"

    # Given the wheel present in our file system
    wheel_file = FIXTURE('storage2/gherkin-0.1.0-py27-none-any.whl')

    # When I parse it
    wheel = Wheel.from_file(wheel_file)

    # Then I see that the wheel file was successfuly read
    wheel.distribution.should.equal('gherkin')
    wheel.version.should.equal('0.1.0')
    wheel.build.should.be.none
    wheel.tags.pyver.should.equal('py27')
    wheel.tags.abi.should.be.none
    wheel.tags.arch.should.be.none
Exemplo n.º 2
0
def test_read_basic_fields():
    """Wheel.from_file() Should parse the WHEEL file of the .whl archive

    The information inside of this file will be used as data source
    for the `Wheel.info()` method.
    """

    # Given the wheel present in our file system
    wheel_file = FIXTURE('storage2/gherkin-0.1.0-py27-none-any.whl')

    # When I parse it
    wheel = Wheel.from_file(wheel_file)

    # Then I see that
    # And then I also see that the file WHEEL was correctly parsed
    wheel.info().should.equal({
        'Wheel-Version': '1.0',
        'Generator': 'bdist_wheel (0.21.0)',
        'Root-Is-Purelib': 'true',
        'Tag': ['py27-none-any'],
    })