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'
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()
def test_entry_points_conflict(): clear_samples_dist() wb = WheelBuilder(samples_dir / "entrypoints_conflict.ini") with pytest.raises(EntryPointsConflict): wb.build()
def test_entry_points_conflict(): clear_samples_dist() wb = WheelBuilder(samples_dir / 'entrypoints_conflict.ini') with pytest.raises(EntryPointsConflict): wb.build()
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')
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')