コード例 #1
0
ファイル: test_api.py プロジェクト: abn/poetry-core
def test_build_sdist():
    with temporary_directory() as tmp_dir, cwd(os.path.join(fixtures, "complete")):
        filename = api.build_sdist(tmp_dir)

        with tarfile.open(str(os.path.join(tmp_dir, filename))) as tar:
            namelist = tar.getnames()

            assert "my-package-1.2.3/LICENSE" in namelist
コード例 #2
0
ファイル: test_api.py プロジェクト: vlad0337187/poetry-core
def test_build_sdist():
    with temporary_directory() as tmp_dir, cwd(os.path.join(fixtures, "complete")):
        filename = api.build_sdist(tmp_dir)
        validate_sdist_contents(
            name="my-package",
            version="1.2.3",
            path=str(os.path.join(tmp_dir, filename)),
            files=["LICENSE"],
        )
コード例 #3
0
def test_build_sdist_with_include() -> None:
    with temporary_directory() as tmp_dir, cwd(
            os.path.join(fixtures, "with-include")):
        filename = api.build_sdist(tmp_dir)
        validate_sdist_contents(
            name="with-include",
            version="1.2.3",
            path=str(os.path.join(tmp_dir, filename)),
            files=["LICENSE"],
        )
コード例 #4
0
def test_build_sdist_with_bad_path_dep_fails():
    with pytest.raises(
            ValueError) as err, temporary_directory() as tmp_dir, cwd(
                os.path.join(fixtures, "with_bad_path_dep")):
        api.build_sdist(tmp_dir)
    assert "does not exist" in str(err.value)
コード例 #5
0
def test_build_sdist_with_bad_path_dev_dep_succeeds():
    with temporary_directory() as tmp_dir, cwd(
            os.path.join(fixtures, "with_bad_path_dev_dep")):
        api.build_sdist(tmp_dir)