Skip to content

Commit 695a548

Browse files
zkoppertCopilot
andcommitted
test: cover all alternative manifest files for new ecosystems
Expand test_build_dependabot_file_with_new_ecosystems from 15 subtests to 26 by testing every manifest filename variant, not just the first one per ecosystem. This covers alternative files like WORKSPACE for bazel, compose.yaml for docker-compose, .pre-commit.yml for pre-commit, etc. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9c4eb1e commit 695a548

1 file changed

Lines changed: 32 additions & 20 deletions

File tree

test_dependabot_file.py

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -421,26 +421,38 @@ def test_build_dependabot_file_with_gradle(self):
421421
self.assertEqual(result, expected_result)
422422

423423
def test_build_dependabot_file_with_new_ecosystems(self):
424-
"""Test that the dependabot.yml file is built correctly for newly added ecosystems"""
425-
ecosystems = {
426-
"bazel": "MODULE.bazel",
427-
"bun": "bun.lock",
428-
"conda": "environment.yml",
429-
"docker-compose": "docker-compose.yml",
430-
"dotnet-sdk": "global.json",
431-
"elm": "elm.json",
432-
"gitsubmodule": ".gitmodules",
433-
"helm": "Chart.yaml",
434-
"julia": "Project.toml",
435-
"pre-commit": ".pre-commit-config.yaml",
436-
"pub": "pubspec.yaml",
437-
"rust-toolchain": "rust-toolchain.toml",
438-
"swift": "Package.swift",
439-
"uv": "uv.lock",
440-
"vcpkg": "vcpkg.json",
441-
}
442-
for ecosystem, manifest_file in ecosystems.items():
443-
with self.subTest(ecosystem=ecosystem, manifest_file=manifest_file):
424+
"""Test that the dependabot.yml file is built correctly for newly added ecosystems.
425+
Each (ecosystem, manifest_file) pair gets its own subTest so every
426+
alternative manifest filename is verified, not just the first one."""
427+
ecosystems = [
428+
("bazel", "MODULE.bazel"),
429+
("bazel", "WORKSPACE"),
430+
("bazel", "WORKSPACE.bazel"),
431+
("bun", "bun.lock"),
432+
("conda", "environment.yml"),
433+
("conda", "environment.yaml"),
434+
("docker-compose", "docker-compose.yml"),
435+
("docker-compose", "docker-compose.yaml"),
436+
("docker-compose", "compose.yaml"),
437+
("docker-compose", "compose.yml"),
438+
("dotnet-sdk", "global.json"),
439+
("elm", "elm.json"),
440+
("gitsubmodule", ".gitmodules"),
441+
("helm", "Chart.yaml"),
442+
("julia", "Project.toml"),
443+
("pre-commit", ".pre-commit-config.yaml"),
444+
("pre-commit", ".pre-commit-config.yml"),
445+
("pre-commit", ".pre-commit.yaml"),
446+
("pre-commit", ".pre-commit.yml"),
447+
("pub", "pubspec.yaml"),
448+
("rust-toolchain", "rust-toolchain.toml"),
449+
("rust-toolchain", "rust-toolchain"),
450+
("swift", "Package.swift"),
451+
("uv", "uv.lock"),
452+
("vcpkg", "vcpkg.json"),
453+
("vcpkg", "vcpkg-configuration.json"),
454+
]
455+
for ecosystem, manifest_file in ecosystems:
444456
repo = MagicMock()
445457
repo.file_contents.side_effect = lambda f, mf=manifest_file: f == mf
446458

0 commit comments

Comments
 (0)