Skip to content

Commit 64d8a55

Browse files
committed
test(poetry): should normalize project name from pyproject.toml
1 parent 363e6a5 commit 64d8a55

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

crates/pet-poetry/src/pyproject_toml.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,32 @@ readme = "README.md"
8585
python = "^3.12"
8686
8787
88+
[build-system]
89+
requires = ["poetry-core"]
90+
build-backend = "poetry.core.masonry.api"
91+
"#;
92+
assert_eq!(
93+
parse_contents(cfg, Path::new("pyproject.toml"))
94+
.unwrap()
95+
.name,
96+
"poetry-demo"
97+
);
98+
}
99+
100+
#[test]
101+
fn extract_normalized_name_from_pyproject_toml() {
102+
let cfg = r#"
103+
[tool.poetry]
104+
name = "poetry_.demo"
105+
version = "0.1.0"
106+
description = ""
107+
authors = ["User Name <bogus.user@some.email.com>"]
108+
readme = "README.md"
109+
110+
[tool.poetry.dependencies]
111+
python = "^3.12"
112+
113+
88114
[build-system]
89115
requires = ["poetry-core"]
90116
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)