-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for go packages in manifest files (#148)
* Add support for go packages in manifest files Signed-off-by: Tushar Goel <[email protected]> * Fix failing tests Signed-off-by: Tushar Goel <[email protected]> * Add documentation about go packages in mod files Signed-off-by: Tushar Goel <[email protected]> * Fix doctests Signed-off-by: Tushar Goel <[email protected]> * Fix linting errors Signed-off-by: Tushar Goel <[email protected]> * Raise exception when go_package contains @ Signed-off-by: Tushar Goel <[email protected]> * Add tests Signed-off-by: Tushar Goel <[email protected]> * Address review comments Signed-off-by: Tushar Goel <[email protected]> * Change python_version to 3.8 for mypy Signed-off-by: Tushar Goel <[email protected]> --------- Signed-off-by: Tushar Goel <[email protected]>
- Loading branch information
Showing
4 changed files
with
29 additions
and
2 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
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 |
---|---|---|
|
@@ -24,6 +24,8 @@ | |
# Visit https://github.com/package-url/packageurl-python for support and | ||
# download. | ||
|
||
import pytest | ||
|
||
from packageurl.contrib.django.utils import purl_to_lookups | ||
from packageurl.utils import get_golang_purl | ||
|
||
|
@@ -66,3 +68,9 @@ def test_get_golang_purl(): | |
) | ||
assert golang_purl_1.name == "v3" | ||
assert golang_purl_1.namespace == "github.com/envoyproxy/go-control-plane/envoy/config/listener" | ||
golang_purl_2 = get_golang_purl( | ||
go_package="github.com/grpc-ecosystem/go-grpc-middleware v1.3.0" | ||
) | ||
assert "pkg:golang/github.com/grpc-ecosystem/[email protected]" == str(golang_purl_2) | ||
with pytest.raises(Exception): | ||
get_golang_purl("github.com/envoyproxy/go-control-plane/envoy/config/[email protected]") |