@@ -1237,6 +1237,48 @@ mod tests {
12371237 assert_yaml_snapshot ! ( content) ;
12381238 }
12391239
1240+ #[ test]
1241+ fn test_save_poetry_pyproject_toml_application_with_python_extras ( ) {
1242+ let mut project_info = project_info_dummy ( ) ;
1243+ project_info. project_manager = ProjectManager :: Poetry ;
1244+ project_info. is_application = true ;
1245+ project_info. extra_python_packages = Some ( vec ! [
1246+ 1247+ 1248+ ] ) ;
1249+ let base = project_info. base_dir ( ) ;
1250+ create_dir_all ( & base) . unwrap ( ) ;
1251+ let expected_file = base. join ( "pyproject.toml" ) ;
1252+ save_pyproject_toml_file ( & project_info) . unwrap ( ) ;
1253+
1254+ assert ! ( expected_file. is_file( ) ) ;
1255+
1256+ let content = std:: fs:: read_to_string ( expected_file) . unwrap ( ) ;
1257+
1258+ assert_yaml_snapshot ! ( content) ;
1259+ }
1260+
1261+ #[ test]
1262+ fn test_save_poetry_pyproject_toml_lib_with_python_extras ( ) {
1263+ let mut project_info = project_info_dummy ( ) ;
1264+ project_info. project_manager = ProjectManager :: Poetry ;
1265+ project_info. is_application = false ;
1266+ project_info. extra_python_packages = Some ( vec ! [
1267+ 1268+ 1269+ ] ) ;
1270+ let base = project_info. base_dir ( ) ;
1271+ create_dir_all ( & base) . unwrap ( ) ;
1272+ let expected_file = base. join ( "pyproject.toml" ) ;
1273+ save_pyproject_toml_file ( & project_info) . unwrap ( ) ;
1274+
1275+ assert ! ( expected_file. is_file( ) ) ;
1276+
1277+ let content = std:: fs:: read_to_string ( expected_file) . unwrap ( ) ;
1278+
1279+ assert_yaml_snapshot ! ( content) ;
1280+ }
1281+
12401282 #[ test]
12411283 fn test_save_poetry_pyproject_toml_file_apache_application ( ) {
12421284 let mut project_info = project_info_dummy ( ) ;
@@ -1309,6 +1351,48 @@ mod tests {
13091351 assert_yaml_snapshot ! ( content) ;
13101352 }
13111353
1354+ #[ test]
1355+ fn test_save_pyproject_toml_file_pyo3_application_with_python_extras ( ) {
1356+ let mut project_info = project_info_dummy ( ) ;
1357+ project_info. project_manager = ProjectManager :: Maturin ;
1358+ project_info. is_application = true ;
1359+ project_info. extra_python_packages = Some ( vec ! [
1360+ 1361+ 1362+ ] ) ;
1363+ let base = project_info. base_dir ( ) ;
1364+ create_dir_all ( & base) . unwrap ( ) ;
1365+ let expected_file = base. join ( "pyproject.toml" ) ;
1366+ save_pyproject_toml_file ( & project_info) . unwrap ( ) ;
1367+
1368+ assert ! ( expected_file. is_file( ) ) ;
1369+
1370+ let content = std:: fs:: read_to_string ( expected_file) . unwrap ( ) ;
1371+
1372+ assert_yaml_snapshot ! ( content) ;
1373+ }
1374+
1375+ #[ test]
1376+ fn test_save_pyproject_toml_file_pyo3_lib_with_python_extras ( ) {
1377+ let mut project_info = project_info_dummy ( ) ;
1378+ project_info. project_manager = ProjectManager :: Maturin ;
1379+ project_info. is_application = false ;
1380+ project_info. extra_python_packages = Some ( vec ! [
1381+ 1382+ 1383+ ] ) ;
1384+ let base = project_info. base_dir ( ) ;
1385+ create_dir_all ( & base) . unwrap ( ) ;
1386+ let expected_file = base. join ( "pyproject.toml" ) ;
1387+ save_pyproject_toml_file ( & project_info) . unwrap ( ) ;
1388+
1389+ assert ! ( expected_file. is_file( ) ) ;
1390+
1391+ let content = std:: fs:: read_to_string ( expected_file) . unwrap ( ) ;
1392+
1393+ assert_yaml_snapshot ! ( content) ;
1394+ }
1395+
13121396 #[ test]
13131397 fn test_save_pyproject_toml_file_apache_pyo3 ( ) {
13141398 let mut project_info = project_info_dummy ( ) ;
@@ -1363,6 +1447,48 @@ mod tests {
13631447 assert_yaml_snapshot ! ( content) ;
13641448 }
13651449
1450+ #[ test]
1451+ fn test_save_pyproject_toml_file_setuptools_application_with_python_extras ( ) {
1452+ let mut project_info = project_info_dummy ( ) ;
1453+ project_info. project_manager = ProjectManager :: Setuptools ;
1454+ project_info. is_application = true ;
1455+ project_info. extra_python_packages = Some ( vec ! [
1456+ 1457+ 1458+ ] ) ;
1459+ let base = project_info. base_dir ( ) ;
1460+ create_dir_all ( & base) . unwrap ( ) ;
1461+ let expected_file = base. join ( "pyproject.toml" ) ;
1462+ save_pyproject_toml_file ( & project_info) . unwrap ( ) ;
1463+
1464+ assert ! ( expected_file. is_file( ) ) ;
1465+
1466+ let content = std:: fs:: read_to_string ( expected_file) . unwrap ( ) ;
1467+
1468+ assert_yaml_snapshot ! ( content) ;
1469+ }
1470+
1471+ #[ test]
1472+ fn test_save_pyproject_toml_file_setuptools_lib_with_python_extras ( ) {
1473+ let mut project_info = project_info_dummy ( ) ;
1474+ project_info. project_manager = ProjectManager :: Setuptools ;
1475+ project_info. is_application = false ;
1476+ project_info. extra_python_packages = Some ( vec ! [
1477+ 1478+ 1479+ ] ) ;
1480+ let base = project_info. base_dir ( ) ;
1481+ create_dir_all ( & base) . unwrap ( ) ;
1482+ let expected_file = base. join ( "pyproject.toml" ) ;
1483+ save_pyproject_toml_file ( & project_info) . unwrap ( ) ;
1484+
1485+ assert ! ( expected_file. is_file( ) ) ;
1486+
1487+ let content = std:: fs:: read_to_string ( expected_file) . unwrap ( ) ;
1488+
1489+ assert_yaml_snapshot ! ( content) ;
1490+ }
1491+
13661492 #[ test]
13671493 fn test_save_setuptools_pyproject_toml_file_apache_application ( ) {
13681494 let mut project_info = project_info_dummy ( ) ;
@@ -1435,6 +1561,48 @@ mod tests {
14351561 assert_yaml_snapshot ! ( content) ;
14361562 }
14371563
1564+ #[ test]
1565+ fn test_save_pyproject_toml_file_uv_application_with_python_extras ( ) {
1566+ let mut project_info = project_info_dummy ( ) ;
1567+ project_info. project_manager = ProjectManager :: Uv ;
1568+ project_info. is_application = true ;
1569+ project_info. extra_python_packages = Some ( vec ! [
1570+ 1571+ 1572+ ] ) ;
1573+ let base = project_info. base_dir ( ) ;
1574+ create_dir_all ( & base) . unwrap ( ) ;
1575+ let expected_file = base. join ( "pyproject.toml" ) ;
1576+ save_pyproject_toml_file ( & project_info) . unwrap ( ) ;
1577+
1578+ assert ! ( expected_file. is_file( ) ) ;
1579+
1580+ let content = std:: fs:: read_to_string ( expected_file) . unwrap ( ) ;
1581+
1582+ assert_yaml_snapshot ! ( content) ;
1583+ }
1584+
1585+ #[ test]
1586+ fn test_save_pyproject_toml_file_uv_lib_with_python_extras ( ) {
1587+ let mut project_info = project_info_dummy ( ) ;
1588+ project_info. project_manager = ProjectManager :: Uv ;
1589+ project_info. is_application = false ;
1590+ project_info. extra_python_packages = Some ( vec ! [
1591+ 1592+ 1593+ ] ) ;
1594+ let base = project_info. base_dir ( ) ;
1595+ create_dir_all ( & base) . unwrap ( ) ;
1596+ let expected_file = base. join ( "pyproject.toml" ) ;
1597+ save_pyproject_toml_file ( & project_info) . unwrap ( ) ;
1598+
1599+ assert ! ( expected_file. is_file( ) ) ;
1600+
1601+ let content = std:: fs:: read_to_string ( expected_file) . unwrap ( ) ;
1602+
1603+ assert_yaml_snapshot ! ( content) ;
1604+ }
1605+
14381606 #[ test]
14391607 fn test_save_uv_pyproject_toml_file_apache_application ( ) {
14401608 let mut project_info = project_info_dummy ( ) ;
@@ -1507,6 +1675,48 @@ mod tests {
15071675 assert_yaml_snapshot ! ( content) ;
15081676 }
15091677
1678+ #[ test]
1679+ fn test_save_pyproject_toml_file_pixi_application_with_python_extras ( ) {
1680+ let mut project_info = project_info_dummy ( ) ;
1681+ project_info. project_manager = ProjectManager :: Pixi ;
1682+ project_info. is_application = true ;
1683+ project_info. extra_python_packages = Some ( vec ! [
1684+ 1685+ 1686+ ] ) ;
1687+ let base = project_info. base_dir ( ) ;
1688+ create_dir_all ( & base) . unwrap ( ) ;
1689+ let expected_file = base. join ( "pyproject.toml" ) ;
1690+ save_pyproject_toml_file ( & project_info) . unwrap ( ) ;
1691+
1692+ assert ! ( expected_file. is_file( ) ) ;
1693+
1694+ let content = std:: fs:: read_to_string ( expected_file) . unwrap ( ) ;
1695+
1696+ assert_yaml_snapshot ! ( content) ;
1697+ }
1698+
1699+ #[ test]
1700+ fn test_save_pyproject_toml_file_pixi_lib_with_python_extras ( ) {
1701+ let mut project_info = project_info_dummy ( ) ;
1702+ project_info. project_manager = ProjectManager :: Pixi ;
1703+ project_info. is_application = false ;
1704+ project_info. extra_python_packages = Some ( vec ! [
1705+ 1706+ 1707+ ] ) ;
1708+ let base = project_info. base_dir ( ) ;
1709+ create_dir_all ( & base) . unwrap ( ) ;
1710+ let expected_file = base. join ( "pyproject.toml" ) ;
1711+ save_pyproject_toml_file ( & project_info) . unwrap ( ) ;
1712+
1713+ assert ! ( expected_file. is_file( ) ) ;
1714+
1715+ let content = std:: fs:: read_to_string ( expected_file) . unwrap ( ) ;
1716+
1717+ assert_yaml_snapshot ! ( content) ;
1718+ }
1719+
15101720 #[ test]
15111721 fn test_save_pixi_pyproject_toml_file_apache_application ( ) {
15121722 let mut project_info = project_info_dummy ( ) ;
0 commit comments