Skip to content

Commit

Permalink
Add the product-details endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémy HUBSCHER committed Aug 7, 2017
1 parent 144cc15 commit 2398fe3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pollbot/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ def get_app(loop=None):
release.bedrock_release_notes)
app.router.add_get('/v1/{product}/{version}/bedrock/security-advisories',
release.bedrock_security_advisories)
app.router.add_get('/v1/{product}/{version}/product-details',
release.product_details)
return app
2 changes: 2 additions & 0 deletions pollbot/views/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from ..exceptions import TaskError
from ..tasks.archives import archives_published
from ..tasks.bedrock import release_notes_published, security_advisories_published
from ..tasks.product_details import product_details_published


def status_response(task):
Expand Down Expand Up @@ -33,3 +34,4 @@ async def wrapped(request):
archive = status_response(archives_published)
bedrock_release_notes = status_response(release_notes_published)
bedrock_security_advisories = status_response(security_advisories_published)
product_details = status_response(product_details_published)
15 changes: 15 additions & 0 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,18 @@ async def test_release_bedrock_security_advisories_404(cli):
"status": 404,
"message": "Invalid product: invalid-product not in ['firefox']"
})


async def test_release_product_details(cli):
await check_response(cli, "/v1/firefox/54.0/product-details",
body={
"status": "exists"
})


async def test_release_product_details_404(cli):
await check_response(cli, "/v1/invalid-product/54.0/product-details",
status=404, body={
"status": 404,
"message": "Invalid product: invalid-product not in ['firefox']"
})

0 comments on commit 2398fe3

Please sign in to comment.