diff --git a/pyproject.toml b/pyproject.toml index fe3976f1..079c7a92 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "readmeai" -version = "0.5.077" +version = "0.5.078" description = "👾 Automated README file generator, powered by large language model APIs." authors = ["Eli "] license = "MIT" diff --git a/tests/parsers/language/test_rust.py b/tests/parsers/language/test_rust.py index 91a0d170..e46632c8 100644 --- a/tests/parsers/language/test_rust.py +++ b/tests/parsers/language/test_rust.py @@ -1,14 +1,9 @@ -"""Unit tests for Rust-based dependency parsers.""" - -import sys +""" +Tests for parsing cargo.toml Rust files. +""" from readmeai.parsers.language.rust import CargoTomlParser -if sys.version_info < (3, 11): - import toml -else: - import tomllib as toml - content = """ [package] name = "lightning-invoice" @@ -58,19 +53,23 @@ def test_cargo_toml_parser(): def test_cargo_toml_parser_missing_section(): parser = CargoTomlParser() - content = toml.dumps({"dependencies": {"packageA": "1.0.0"}}) + content = """ + [dependencies] + packageA = "1.0.0" + """ result = parser.parse(content) assert set(result) == {"packageA"} def test_cargo_toml_parser_extended_dependency_tables(): parser = CargoTomlParser() - content = toml.dumps( - { - "dependencies": {"packageA": "1.0.0"}, - "dependencies.some_feature": {"packageC": "3.0.0"}, - } - ) + content = """ + [dependencies] + packageA = "1.0.0" + + [dev-dependencies] + packageC = "3.0.0" + """ result = parser.parse(content) assert set(result) == {"packageA", "packageC"}