← Back to issue list

test: unit tests for get_package and get_partitions methods

View original Github issue

Metadata

Project
debcraft
Number
#56
Type
pull request
State
open
Author
Copilot
Labels
Created
2025-11-27 22:56:42+00:00
Updated
2025-12-06 16:08:27+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

Issue body

- [x] Have you followed the guidelines for contributing? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `make lint && make test`? --- Addresses review feedback from #54 requesting unit test coverage for the new `get_package` and `get_partitions` methods in project models. ### Changes - Added tests for `Project.get_package()`: - Successful package retrieval - Error when no packages defined - Error when package not found - Added tests for `PackagesProject.get_partitions()`: - Returns `["default"]` when no packages defined - Returns `["default", "package/<name>", ...]` when packages defined ```python def test_get_package_success(default_project): package = default_project.get_package("package-1") assert package.version == "2.0" def test_get_partitions_with_packages(): packages_project = project.PackagesProject( packages={"pkg-a": Package(version="1.0"), "pkg-b": Package(version="2.0")} ) result = packages_project.get_partitions() assert result == ["default", "package/pkg-a", "package/pkg-b"] ``` <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.

Evaluation history

No evaluation history available.