-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bernát Gábor <gaborjbernat@gmail.com>
- Loading branch information
1 parent
0cf63e9
commit 03e16c3
Showing
12 changed files
with
2,303 additions
and
24 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
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,18 @@ | ||
from __future__ import annotations | ||
|
||
import sys | ||
from pathlib import Path | ||
from typing import Callable | ||
from unittest.mock import MagicMock | ||
|
||
if sys.version_info >= (3, 8): # pragma: no cover (py38+) | ||
from importlib.metadata import PathDistribution | ||
else: # pragma: no cover (<py38) | ||
from importlib_metadata import PathDistribution | ||
|
||
MakeDist = Callable[[Path, str, str], MagicMock] | ||
|
||
__all__ = [ | ||
"PathDistribution", | ||
"MakeDist", | ||
] |
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,28 @@ | ||
from __future__ import annotations | ||
|
||
import sys | ||
from pathlib import Path | ||
from unittest.mock import MagicMock, create_autospec | ||
|
||
import pytest | ||
|
||
from pypi_changes._cli import Options | ||
from tests import MakeDist | ||
|
||
|
||
@pytest.fixture() | ||
def option_simple(tmp_path: Path) -> Options: | ||
return Options(cache_path=tmp_path / "a.sqlite", jobs=1, cache_duration=0.01) | ||
|
||
|
||
@pytest.fixture() | ||
def make_dist() -> MakeDist: | ||
def func(path: Path, name: str, version: str) -> MagicMock: | ||
of_type = f"importlib{'.' if sys.version_info >= (3, 8) else '_'}metadata.PathDistribution" | ||
dist: MagicMock = create_autospec(of_type) | ||
dist.metadata = {"Name": name} | ||
dist._path = path / "dist" | ||
dist.version = version | ||
return dist | ||
|
||
return func |
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,226 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
User-Agent: | ||
- python-requests/2.26.0 | ||
method: GET | ||
uri: https://pypi.org/pypi/missing-package/json | ||
response: | ||
body: | ||
string: "<html>\n <head>\n <title>301 Moved Permanently</title>\n </head>\n | ||
<body>\n <h1>301 Moved Permanently</h1>\n The resource has been moved to | ||
/pypi/missing-package/json/; you should be redirected automatically.\n\n\n | ||
</body>\n</html>" | ||
headers: | ||
Accept-Ranges: | ||
- bytes | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '224' | ||
Content-Security-Policy: | ||
- base-uri 'self'; block-all-mixed-content; connect-src 'self' https://api.github.com/repos/ | ||
*.fastly-insights.com sentry.io https://api.pwnedpasswords.com https://2p66nmmycsj3.statuspage.io; | ||
default-src 'none'; font-src 'self' fonts.gstatic.com; form-action 'self'; | ||
frame-ancestors 'none'; frame-src 'none'; img-src 'self' https://warehouse-camo.ingress.cmh1.psfhosted.org/ | ||
www.google-analytics.com *.fastly-insights.com; script-src 'self' www.googletagmanager.com | ||
www.google-analytics.com *.fastly-insights.com https://cdn.ravenjs.com; style-src | ||
'self' fonts.googleapis.com; worker-src *.fastly-insights.com | ||
Content-Type: | ||
- text/html; charset=UTF-8 | ||
Date: | ||
- Fri, 05 Nov 2021 08:54:19 GMT | ||
Location: | ||
- https://pypi.org/pypi/missing-package/json/ | ||
Referrer-Policy: | ||
- origin-when-cross-origin | ||
Server: | ||
- nginx/1.13.9 | ||
Strict-Transport-Security: | ||
- max-age=31536000; includeSubDomains; preload | ||
Vary: | ||
- Accept-Encoding | ||
X-Cache: | ||
- MISS, MISS | ||
X-Cache-Hits: | ||
- 0, 0 | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- deny | ||
X-Permitted-Cross-Domain-Policies: | ||
- none | ||
X-Served-By: | ||
- cache-bwi5177-BWI, cache-lhr7332-LHR | ||
X-Timer: | ||
- S1636102460.677741,VS0,VE106 | ||
X-XSS-Protection: | ||
- 1; mode=block | ||
status: | ||
code: 301 | ||
message: Moved Permanently | ||
- request: | ||
body: null | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
User-Agent: | ||
- python-requests/2.26.0 | ||
method: GET | ||
uri: https://pypi.org/pypi/missing-package/json/ | ||
response: | ||
body: | ||
string: !!binary | | ||
H4sIAAAAAAAC/81YW3PbuBV+z69AOdN0dyLedKHkjOU0cbwbT/fixtkmuy8akDwkYUEAA4CSmT/W | ||
9/6yHvAiUb5kk0wf6hmPARLnfr4Ph37yxP6c/uX1r+fvfr+6IIXZ8LMnp/YP4VTkSweEQ1Kmlg43 | ||
yjl7QshpATS1C1xuwFCSFFRpMEunMpm7cIavCmNKFz5WbLt0Pri/vXTP5aakhsUcHJJIYUCg3OXF | ||
EtIcjiQF3cDS2TLYlVKZweEdS02xTGHLEnCbzYgwwQyj3NUJ5bAMUdE9TSlktOLmJ4ypovnQOgZ4 | ||
3zDdUsYputkL6COJEQE9IpkakRs6IqVZvX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O6RVubMEhZcIgM1xG/Agd4fe6vp736FWfRfHxiambPLiCTDdnaT9pMmOVxblfra6 | ||
uG1Gfk7sqIZPLQ9hflYxDnPr7rtHSDt02Vr8C8tFmgoRg9+arV6LgX3zH7m4X/bd30Ib70JcYwPZ | ||
/w39F4HK9rsxEgAA | ||
headers: | ||
Accept-Ranges: | ||
- bytes | ||
Connection: | ||
- keep-alive | ||
Content-Encoding: | ||
- gzip | ||
Content-Length: | ||
- '1893' | ||
Content-Security-Policy: | ||
- base-uri 'self'; block-all-mixed-content; connect-src 'self' https://api.github.com/repos/ | ||
*.fastly-insights.com sentry.io https://api.pwnedpasswords.com https://2p66nmmycsj3.statuspage.io; | ||
default-src 'none'; font-src 'self' fonts.gstatic.com; form-action 'self'; | ||
frame-ancestors 'none'; frame-src 'none' https://www.youtube-nocookie.com; | ||
img-src 'self' https://warehouse-camo.ingress.cmh1.psfhosted.org/ www.google-analytics.com | ||
*.fastly-insights.com; script-src 'self' www.googletagmanager.com www.google-analytics.com | ||
*.fastly-insights.com https://cdn.ravenjs.com https://www.youtube.com https://s.ytimg.com; | ||
style-src 'self' fonts.googleapis.com; worker-src *.fastly-insights.com | ||
Content-Type: | ||
- text/html; charset=UTF-8 | ||
Date: | ||
- Fri, 05 Nov 2021 08:54:19 GMT | ||
ETag: | ||
- '"iC0+fkUPr9ioHXlCCoAlCw"' | ||
Referrer-Policy: | ||
- origin-when-cross-origin | ||
Server: | ||
- nginx/1.13.9 | ||
Strict-Transport-Security: | ||
- max-age=31536000; includeSubDomains; preload | ||
Vary: | ||
- Accept-Encoding | ||
X-Cache: | ||
- MISS, MISS | ||
X-Cache-Hits: | ||
- 0, 0 | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- deny | ||
X-Permitted-Cross-Domain-Policies: | ||
- none | ||
X-Served-By: | ||
- cache-bwi5162-BWI, cache-lhr7332-LHR | ||
X-Timer: | ||
- S1636102460.800731,VS0,VE110 | ||
X-XSS-Protection: | ||
- 1; mode=block | ||
status: | ||
code: 404 | ||
message: Not Found | ||
- request: | ||
body: null | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
User-Agent: | ||
- python-requests/2.26.0 | ||
method: GET | ||
uri: https://pypi.org/simple/missing-package/ | ||
response: | ||
body: | ||
string: 404 Not Found | ||
headers: | ||
Accept-Ranges: | ||
- bytes | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '13' | ||
Content-Security-Policy: | ||
- default-src 'none'; sandbox allow-top-navigation | ||
Content-Type: | ||
- text/plain; charset=UTF-8 | ||
Date: | ||
- Fri, 05 Nov 2021 08:54:20 GMT | ||
Referrer-Policy: | ||
- origin-when-cross-origin | ||
Server: | ||
- nginx/1.13.9 | ||
Strict-Transport-Security: | ||
- max-age=31536000; includeSubDomains; preload | ||
Vary: | ||
- Accept-Encoding | ||
X-Cache: | ||
- HIT, MISS | ||
X-Cache-Hits: | ||
- 1, 0 | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- deny | ||
X-Permitted-Cross-Domain-Policies: | ||
- none | ||
X-Served-By: | ||
- cache-bwi5166-BWI, cache-lhr7332-LHR | ||
X-Timer: | ||
- S1636102460.929001,VS0,VE80 | ||
X-XSS-Protection: | ||
- 1; mode=block | ||
status: | ||
code: 404 | ||
message: Not Found | ||
version: 1 |
Oops, something went wrong.