예제 #1
0
def test_wheel_builder():
    # Slightly lower level interface
    with tempfile.TemporaryDirectory() as td:
        target = Path(td, 'sample.whl')
        with target.open('wb') as f:
            wb = WheelBuilder(samples_dir / 'package1-pkg.ini', f)
            wb.build()

        assert zipfile.is_zipfile(str(target))
        assert wb.wheel_filename == 'package1-0.1-py2.py3-none-any.whl'
예제 #2
0
파일: test_wheel.py 프로젝트: minrk/flit
def test_entry_points():
    clear_samples_dist()
    WheelBuilder(samples_dir / 'entrypoints_valid.ini').build()
    assert_isfile(samples_dir / 'dist/package1-0.1-py2.py3-none-any.whl')
    with unpack(samples_dir / 'dist/package1-0.1-py2.py3-none-any.whl') as td:
        entry_points = Path(td, 'package1-0.1.dist-info', 'entry_points.txt')
        assert_isfile(entry_points)
        cp = configparser.ConfigParser()
        cp.read(str(entry_points))
        assert 'console_scripts' in cp.sections()
        assert 'myplugins' in cp.sections()
예제 #3
0
def test_entry_points_conflict():
    clear_samples_dist()
    wb = WheelBuilder(samples_dir / "entrypoints_conflict.ini")
    with pytest.raises(EntryPointsConflict):
        wb.build()
예제 #4
0
파일: test_wheel.py 프로젝트: minrk/flit
def test_entry_points_conflict():
    clear_samples_dist()
    wb = WheelBuilder(samples_dir / 'entrypoints_conflict.ini')
    with pytest.raises(EntryPointsConflict):
        wb.build()
예제 #5
0
파일: test_wheel.py 프로젝트: minrk/flit
def test_dist_name():
    clear_samples_dist()
    WheelBuilder(samples_dir / 'altdistname.ini').build()
    assert_isfile(samples_dir / 'dist/packagedist1-0.1-py2.py3-none-any.whl')
예제 #6
0
파일: test_wheel.py 프로젝트: minrk/flit
def test_wheel_package():
    clear_samples_dist()
    WheelBuilder(samples_dir / 'package1-pkg.ini').build()
    assert_isfile(samples_dir / 'dist/package1-0.1-py2.py3-none-any.whl')