-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create debian packages without external processes
- Loading branch information
Showing
3 changed files
with
157 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from textwrap import dedent | ||
|
||
from ops2deb.builder import parse_debian_control | ||
|
||
|
||
def test_parse_debian_control__should_return_dict_with_all_fieds_from_debian_control( | ||
tmp_path, | ||
): | ||
raw_control = dedent( | ||
"""\ | ||
Source: great-app | ||
Priority: optional | ||
Maintainer: ops2deb <[email protected]> | ||
Build-Depends: debhelper, build-dep-1, build-dep-2 | ||
Standards-Version: 3.9.6 | ||
Homepage: http://great-app.io | ||
Package: great-app | ||
Architecture: all | ||
Provides: virtual_package | ||
Depends: package_a | ||
Recommends: package_b | ||
Replaces: package_c | ||
Conflicts: package_d | ||
Description: My great app | ||
A detailed description of the super package | ||
""" | ||
) | ||
(tmp_path / "debian").mkdir() | ||
(tmp_path / "debian" / "control").write_text(raw_control) | ||
control = parse_debian_control(tmp_path) | ||
assert control == { | ||
"Priority": "optional", | ||
"Maintainer": "ops2deb <[email protected]>", | ||
"Build-Depends": "debhelper, build-dep-1, build-dep-2", | ||
"Standards-Version": "3.9.6", | ||
"Homepage": "http://great-app.io", | ||
"Package": "great-app", | ||
"Architecture": "all", | ||
"Provides": "virtual_package", | ||
"Depends": "package_a", | ||
"Recommends": "package_b", | ||
"Replaces": "package_c", | ||
"Conflicts": "package_d", | ||
"Description": "My great app\n A detailed description of the super package", | ||
} |