Skip to content

Commit e2ee24f

Browse files
committed
Revert mocking change to GitHub tests. Changes focused on that can be done at another time
1 parent f1b7aa3 commit e2ee24f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

tests/unit/oidc/test_views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,8 @@ def find_service(iface, **kw):
528528

529529
monkeypatch.setattr(db_request, "find_service", find_service)
530530
monkeypatch.setattr(db_request, "domain", "fakedomain")
531+
# NOTE: Can't set __str__ using pretend.stub()
532+
monkeypatch.setattr(publisher.__class__, "__str__", lambda s: "fakespecifier")
531533

532534
response = views.mint_token(oidc_service, dummy_oidc_jwt, db_request)
533535
assert response == {
@@ -544,7 +546,7 @@ def find_service(iface, **kw):
544546
assert macaroon_service.create_macaroon.calls == [
545547
pretend.call(
546548
"fakedomain",
547-
f"OpenID token: example.yml ({datetime.fromtimestamp(0).isoformat()})",
549+
f"OpenID token: fakespecifier ({datetime.fromtimestamp(0).isoformat()})",
548550
[
549551
caveats.OIDCPublisher(
550552
oidc_publisher_id=str(publisher.id),

warehouse/oidc/models/github.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ def reify(self, session):
269269
Returns a `GitHubPublisher` for this `PendingGitHubPublisher`,
270270
deleting the `PendingGitHubPublisher` in the process.
271271
"""
272+
272273
maybe_publisher = (
273274
session.query(GitHubPublisher)
274275
.filter(

0 commit comments

Comments
 (0)