Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 19, 2024
1 parent 6869da8 commit d280d79
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
15 changes: 9 additions & 6 deletions src/retasc/product_pages_api.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@

# SPDX-License-Identifier: GPL-3.0-or-later
"""
Production Pages API
"""

from functools import lru_cache
from retasc import requests_session
from retasc import constants
import os
from functools import lru_cache

from retasc import constants, requests_session

_no_auth_session = requests_session.requests_session()


class ProductPagesApi:
"""
Product Pages API Client
"""

def __init__(self):
self.pp_release_url = os.getenv("PP_URL", "PP_URL not set") + "releases/"

Expand Down Expand Up @@ -121,8 +122,10 @@ def get_all_active_releases_tasks_for_product(self, product_shortname: str) -> d
f"Product - {product_shortname} is not supported yet. The products we supported currently are {constants.SUPPORTED_PRODUCTS}"
)

releases_list = ProductPagesApi.releases_by_product_phase(self, product_shortname)
all_tasks = {} # type: dict
releases_list = ProductPagesApi.releases_by_product_phase(
self, product_shortname
)
all_tasks = {} # type: dict
all_tasks[product_shortname] = {}
for r in releases_list:
r_name = r["shortname"]
Expand Down
9 changes: 4 additions & 5 deletions tests/test_product_pages_api.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# SPDX-License-Identifier: GPL-3.0+
from retasc.product_pages_api import ProductPagesApi
from retasc.constants import UNSUPPORTED_PHASE_ID, SUPPORTED_PRODUCTS
import requests_mock
import pytest
import requests_mock

from retasc.constants import SUPPORTED_PRODUCTS, UNSUPPORTED_PHASE_ID
from retasc.product_pages_api import ProductPagesApi

url = "https://pp.rh.com/"

Expand Down Expand Up @@ -87,8 +88,6 @@ def test_release_schedules_by_flags(monkeypatch):
res = [
{
"date_finish": "2021-04-08",
"date_start": "2021-03-25",
"name": "Initial configuration for RHSCL 3.8",
"date_start": "2021-09-27",
"name": "File ticket for GA - RC Compose",
"release_shortname": "rhscl-3-8",
Expand Down
6 changes: 4 additions & 2 deletions tests/test_requests_session.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# SPDX-License-Identifier: GPL-3.0+
import json
from retasc import requests_session

import requests_mock

from retasc import requests_session


class TestRequestSession(object):
class TestRequestSession:
def test_req_get(self):
client = requests_session.requests_session()
with requests_mock.Mocker() as m:
Expand Down

0 comments on commit d280d79

Please sign in to comment.