Skip to content

Commit

Permalink
test pyproject toml with comment
Browse files Browse the repository at this point in the history
  • Loading branch information
clavedeluna committed Nov 29, 2023
1 parent 3dc5eb8 commit 4f7c838
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/dependency_management/test_pyproject_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def test_update_pyproject_dependencies(tmpdir, dry_run):
requires = ["setuptools", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
# some comment
[project]
dynamic = ["version"]
name = "codemodder"
Expand Down Expand Up @@ -47,6 +49,8 @@ def test_update_pyproject_dependencies(tmpdir, dry_run):
requires = ["setuptools", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
# some comment
[project]
dynamic = ["version"]
name = "codemodder"
Expand All @@ -70,7 +74,7 @@ def test_update_pyproject_dependencies(tmpdir, dry_run):
res = (
"--- \n"
"+++ \n"
"@@ -11,5 +11,7 @@\n"
"@@ -13,5 +13,7 @@\n"
""" "libcst~=1.1.0",\n"""
""" "pylint~=3.0.0",\n"""
""" "PyYAML~=6.0.0",\n"""
Expand All @@ -82,14 +86,14 @@ def test_update_pyproject_dependencies(tmpdir, dry_run):
assert len(changeset.changes) == 2
change_one = changeset.changes[0]

assert change_one.lineNumber == 14
assert change_one.lineNumber == 16
assert change_one.description == DefusedXML.build_description()
assert change_one.properties == {
"contextual_description": True,
"contextual_description_position": "right",
}
change_two = changeset.changes[1]
assert change_two.lineNumber == 15
assert change_two.lineNumber == 17
assert change_two.description == Security.build_description()
assert change_two.properties == {
"contextual_description": True,
Expand Down

0 comments on commit 4f7c838

Please sign in to comment.