-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I understand that my formatting lacks rhyme or reason, but now this is consistent with the rest of the files.
- Loading branch information
Showing
2 changed files
with
75 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,29 +21,30 @@ def __init__(self, *args: Any) -> None: | |
def test_create(self, *, rmock: requests_mock.Mocker) -> None: | ||
rmock.post("http://test/api/mirrors", | ||
text="""{"UUID": "2cb5985a-a23f-4a1f-8eb6-d5409193b4eb", | ||
"Name": "aptly-mirror", | ||
"ArchiveRoot": "https://deb.nodesource.com/node_10.x/", | ||
"Distribution": "bionic", "Components": ["main"], | ||
"Architectures": ["amd64"], | ||
"Meta": [{"Architectures": "i386 amd64 armhf arm64", | ||
"Codename": "bionic", "Components": "main", | ||
"Date": "Tue, 06 Apr 2021 21:05:41 UTC", | ||
"Description": " Apt Repository for the Node.JS 10.x Branch", | ||
"Label": "Node Source", "Origin": "Node Source"}], | ||
"LastDownloadDate": "0001-01-01T00:00:00Z", | ||
"Filter": "test", "Status": 0, "WorkerPID": 0, | ||
"FilterWithDeps": true, "SkipComponentCheck": true, | ||
"SkipArchitectureCheck": true, "DownloadSources": true, | ||
"DownloadUdebs": true, "DownloadInstaller": true}""" | ||
) | ||
"Name": "aptly-mirror", | ||
"ArchiveRoot": "https://deb.nodesource.com/node_10.x/", | ||
"Distribution": "bionic", "Components": ["main"], | ||
"Architectures": ["amd64"], | ||
"Meta": [{"Architectures": "i386 amd64 armhf arm64", | ||
"Codename": "bionic", "Components": "main", | ||
"Date": "Tue, 06 Apr 2021 21:05:41 UTC", | ||
"Description": " Apt Repository for the Node.JS 10.x Branch", | ||
"Label": "Node Source", "Origin": "Node Source"}], | ||
"LastDownloadDate": "0001-01-01T00:00:00Z", | ||
"Filter": "test", "Status": 0, "WorkerPID": 0, | ||
"FilterWithDeps": true, "SkipComponentCheck": true, | ||
"SkipArchitectureCheck": true, "DownloadSources": true, | ||
"DownloadUdebs": true, "DownloadInstaller": true}""") | ||
self.assertSequenceEqual( | ||
self.miapi.create(name="aptly-mirror", archiveurl='https://deb.nodesource.com/node_10.x/', | ||
distribution='bionic', components=["main"], | ||
architectures=["amd64"], | ||
filter="test", download_udebs=True, | ||
download_sources=True, download_installer=True, | ||
skip_component_check=True, filter_with_deps=True, | ||
keyrings=["/path/to/keyring"], ignore_signatures=True), | ||
self.miapi.create( | ||
name="aptly-mirror", archiveurl='https://deb.nodesource.com/node_10.x/', | ||
distribution='bionic', components=["main"], | ||
architectures=["amd64"], | ||
filter="test", download_udebs=True, | ||
download_sources=True, download_installer=True, | ||
skip_component_check=True, filter_with_deps=True, | ||
keyrings=["/path/to/keyring"], ignore_signatures=True | ||
), | ||
Mirror( | ||
uuid='2cb5985a-a23f-4a1f-8eb6-d5409193b4eb', | ||
name="aptly-mirror", | ||
|
@@ -67,28 +68,26 @@ def test_create(self, *, rmock: requests_mock.Mocker) -> None: | |
download_sources=True, | ||
download_udebs=True, | ||
download_installer=True | ||
|
||
) | ||
) | ||
|
||
def test_list(self, *, rmock: requests_mock.Mocker) -> None: | ||
rmock.get("http://test/api/mirrors", | ||
text="""[{"UUID": "2cb5985a-a23f-4a1f-8eb6-d5409193b4eb", | ||
"Name": "aptly-mirror", | ||
"ArchiveRoot": "https://deb.nodesource.com/node_10.x/", | ||
"Distribution": "bionic", "Components": ["main"], | ||
"Architectures": ["amd64"], | ||
"Meta": [{"Architectures": "i386 amd64 armhf arm64", | ||
"Codename": "bionic", "Components": "main", | ||
"Date": "Tue, 06 Apr 2021 21:05:41 UTC", | ||
"Description": " Apt Repository for the Node.JS 10.x Branch", | ||
"Label": "Node Source", "Origin": "Node Source"}], | ||
"LastDownloadDate": "0001-01-01T00:00:00Z", "Filter": "", | ||
"Status": 0, "WorkerPID": 0, "FilterWithDeps": false, | ||
"SkipComponentCheck": false, "SkipArchitectureCheck": false, | ||
"DownloadSources": false, "DownloadUdebs": false, | ||
"DownloadInstaller": false}]""" | ||
) | ||
"Name": "aptly-mirror", | ||
"ArchiveRoot": "https://deb.nodesource.com/node_10.x/", | ||
"Distribution": "bionic", "Components": ["main"], | ||
"Architectures": ["amd64"], | ||
"Meta": [{"Architectures": "i386 amd64 armhf arm64", | ||
"Codename": "bionic", "Components": "main", | ||
"Date": "Tue, 06 Apr 2021 21:05:41 UTC", | ||
"Description": " Apt Repository for the Node.JS 10.x Branch", | ||
"Label": "Node Source", "Origin": "Node Source"}], | ||
"LastDownloadDate": "0001-01-01T00:00:00Z", "Filter": "", | ||
"Status": 0, "WorkerPID": 0, "FilterWithDeps": false, | ||
"SkipComponentCheck": false, "SkipArchitectureCheck": false, | ||
"DownloadSources": false, "DownloadUdebs": false, | ||
"DownloadInstaller": false}]""") | ||
self.assertSequenceEqual( | ||
self.miapi.list(), | ||
[ | ||
|
@@ -123,21 +122,20 @@ def test_list(self, *, rmock: requests_mock.Mocker) -> None: | |
def test_show(self, *, rmock: requests_mock.Mocker) -> None: | ||
rmock.get("http://test/api/mirrors/aptly-mirror", | ||
text="""{"UUID": "2cb5985a-a23f-4a1f-8eb6-d5409193b4eb", | ||
"Name": "aptly-mirror", | ||
"ArchiveRoot": "https://deb.nodesource.com/node_10.x/", | ||
"Distribution": "bionic", "Components": ["main"], | ||
"Architectures": ["amd64"], | ||
"Meta": [{"Architectures": "i386 amd64 armhf arm64", | ||
"Codename": "bionic", "Components": "main", | ||
"Date": "Tue, 06 Apr 2021 21:05:41 UTC", | ||
"Description": " Apt Repository for the Node.JS 10.x Branch", | ||
"Label": "Node Source", "Origin": "Node Source"}], | ||
"LastDownloadDate": "0001-01-01T00:00:00Z", "Filter": "", | ||
"Status": 0, "WorkerPID": 0, "FilterWithDeps": false, | ||
"SkipComponentCheck": false, "SkipArchitectureCheck": false, | ||
"DownloadSources": false, "DownloadUdebs": false, | ||
"DownloadInstaller": false}""" | ||
) | ||
"Name": "aptly-mirror", | ||
"ArchiveRoot": "https://deb.nodesource.com/node_10.x/", | ||
"Distribution": "bionic", "Components": ["main"], | ||
"Architectures": ["amd64"], | ||
"Meta": [{"Architectures": "i386 amd64 armhf arm64", | ||
"Codename": "bionic", "Components": "main", | ||
"Date": "Tue, 06 Apr 2021 21:05:41 UTC", | ||
"Description": " Apt Repository for the Node.JS 10.x Branch", | ||
"Label": "Node Source", "Origin": "Node Source"}], | ||
"LastDownloadDate": "0001-01-01T00:00:00Z", "Filter": "", | ||
"Status": 0, "WorkerPID": 0, "FilterWithDeps": false, | ||
"SkipComponentCheck": false, "SkipArchitectureCheck": false, | ||
"DownloadSources": false, "DownloadUdebs": false, | ||
"DownloadInstaller": false}""") | ||
self.assertSequenceEqual( | ||
self.miapi.show(name="aptly-mirror"), | ||
Mirror( | ||
|
@@ -186,33 +184,28 @@ def test_list_packages(self, *, rmock: requests_mock.Mocker) -> None: | |
def test_list_packages_details(self, *, rmock: requests_mock.Mocker) -> None: | ||
rmock.get( | ||
"http://test/api/mirrors/aptly-mirror/packages?format=details", | ||
text="""[{ | ||
"Architecture":"amd64", | ||
"Conflicts": "nodejs-dev, nodejs-legacy, npm", | ||
"Depends":"1libc6 (>= 2.9), libgcc1 (>= 1:3.4),""" | ||
""" libstdc++6 (>= 4.4.0), python-minimal, ca-certificates", | ||
"Description":" Node.js event-based server-side javascript engine\\n", | ||
"Filename":"nodejs_10.24.1-1nodesource1_amd64.deb", | ||
"FilesHash":"1f74a6abf6acc572", | ||
"Homepage":"https://nodejs.org", | ||
"Installed-Size":"78630", | ||
"Key":"Pamd64 nodejs 10.24.1-1nodesource1 1f74a6abf6acc572", | ||
"License":"unknown", | ||
"MD5sum":"6d9f0e30396cb6c20945ff6de2f9f322", | ||
"Maintainer":"Ivan Iguaran <[email protected]>", | ||
"Package":"nodejs", | ||
"Priority":"optional", | ||
"Provides":"nodejs-dev, nodejs-legacy, npm", | ||
"SHA1":"a3bc5a29614eab366bb3644abb1e602b5c8953d5", | ||
"SHA256":"4b374d16b536cf1a3963ddc4575ed2b68b28b0b5ea6eefe93c942dfc0ed35177", | ||
"SHA512":"bf203bb319de0c5f7ed3b6ba69de39b1ea8b5086b872561379bd462dd93f0796""" | ||
"""9ca64fa01ade01ff08fa13a4e5e28625b59292ba44bc01ba876ec95875630460", | ||
"Section":"web", | ||
"ShortKey":"Pamd64 nodejs 10.24.1-1nodesource1", | ||
"Size":"15949164", | ||
"Version":"10.24.1-1nodesource1" | ||
}]""" | ||
) | ||
text='[{"Architecture":"amd64",' | ||
'"Conflicts": "nodejs-dev, nodejs-legacy, npm",' | ||
'"Depends":"1libc6 (>= 2.9), libgcc1 (>= 1:3.4),' | ||
'libstdc++6 (>= 4.4.0), python-minimal, ca-certificates",' | ||
'"Description":" Node.js event-based server-side javascript engine\\n",' | ||
'"Filename":"nodejs_10.24.1-1nodesource1_amd64.deb",' | ||
'"FilesHash":"1f74a6abf6acc572",' | ||
'"Homepage":"https://nodejs.org",' | ||
'"Installed-Size":"78630", "Key":"Pamd64 nodejs 10.24.1-1nodesource11f74a6abf6acc572",' | ||
'"License":"unknown",' | ||
'"MD5sum":"6d9f0e30396cb6c20945ff6de2f9f322","Maintainer":"Ivan Iguaran <[email protected]>",' | ||
'"Package":"nodejs",' | ||
'"Priority":"optional",' | ||
'"Provides":"nodejs-dev, nodejs-legacy, npm",' | ||
'"SHA1":"a3bc5a29614eab366bb3644abb1e602b5c8953d5",' | ||
'"SHA256":"4b374d16b536cf1a3963ddc4575ed2b68b28b0b5ea6eefe93c942dfc0ed35177",' | ||
'"SHA512":"bf203bb319de0c5f7ed3b6ba69de39b1ea8b5086b872561379bd462dd93f0796' | ||
'9ca64fa01ade01ff08fa13a4e5e28625b59292ba44bc01ba876ec95875630460",' | ||
'"Section":"web",' | ||
'"ShortKey":"Pamd64 nodejs 10.24.1-1nodesource1",' | ||
'"Size":"15949164",' | ||
'Version":"10.24.1-1nodesource1"}]') | ||
self.assertSequenceEqual( | ||
self.miapi.list_packages( | ||
"aptly-mirror", detailed=True, with_deps=True, query="nodejs"), | ||
|