def test_build_wheel_no_toml(tmp_path, mocker):
    os.chdir(tmp_path)
    orig_wheel = mocker.patch('jupyter_packaging.build_api.orig_build_wheel')
    build_wheel(tmp_path)
    orig_wheel.assert_called_with(tmp_path,
                                  config_settings=None,
                                  metadata_directory=None)
예제 #2
0
def test_build_wheel_bad_toml(tmp_path, mocker):
    os.chdir(tmp_path)
    tmp_path.joinpath('foo.py').write_text(FOO_CONTENT)
    tmp_path.joinpath('pyproject.toml').write_text(BAD_CONTENT, encoding='utf-8')
    orig_wheel = mocker.patch('jupyter_packaging.build_api.orig_build_wheel')
    with pytest.raises(ValueError):
        build_wheel(tmp_path)
    orig_wheel.assert_not_called()
예제 #3
0
def test_build_wheel(tmp_path, mocker):
    os.chdir(tmp_path)
    tmp_path.joinpath('foo.py').write_text(FOO_CONTENT)
    tmp_path.joinpath('pyproject.toml').write_text(TOML_CONTENT, encoding='utf-8')
    orig_wheel = mocker.patch('jupyter_packaging.build_api.orig_build_wheel')
    build_wheel(tmp_path)
    orig_wheel.assert_called_with(tmp_path, config_settings=None, metadata_directory=None)
    data = tmp_path.joinpath('foo.txt').read_text(encoding='utf-8')
    assert data == 'fizz=buzz'