Skip to content

Fix warning in tests for URL verification #16528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions tests/unit/forklift/test_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
Project,
ProjectMacaroonWarningAssociation,
Release,
ReleaseURL,
Role,
)
from warehouse.packaging.tasks import sync_file_to_cache, update_bigquery_release_files
Expand Down Expand Up @@ -3902,11 +3901,11 @@ def test_new_release_url_verified(
}.get(svc)

legacy.file_upload(db_request)
release_url = (
db_request.db.query(ReleaseURL).filter(Release.project == project).one()
release_db = (
db_request.db.query(Release).filter(Release.project == project).one()
)
assert release_url is not None
assert release_url.verified == expected
assert release_db.urls_by_verify_status(expected) == {"Test": url}
assert not release_db.urls_by_verify_status(not expected)

def test_new_publisher_verifies_existing_release_url(
self,
Expand Down Expand Up @@ -3980,13 +3979,14 @@ def test_new_publisher_verifies_existing_release_url(
legacy.file_upload(db_request)

# After successful upload, the Release should have now both URLs verified
release_urls = (
db_request.db.query(ReleaseURL).filter(Release.project == project).all()
release_db = (
db_request.db.query(Release).filter(Release.project == project).one()
)
release_urls = {r.name: r.verified for r in release_urls}
assert "verified_url" in release_urls and "unverified_url" in release_urls
assert release_urls["verified_url"]
assert release_urls["unverified_url"]
assert release_db.urls_by_verify_status(True) == {
"unverified_url": unverified_url,
"verified_url": verified_url,
}
assert not release_db.urls_by_verify_status(False)

@pytest.mark.parametrize(
"version, expected_version",
Expand Down
Loading