Skip to content

Commit 9075399

Browse files
committed
Fix unit tests
1 parent b44aba4 commit 9075399

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

tests/fixtures/products.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ def user_product_create_payload(request) -> dict:
9797

9898
@pytest.fixture
9999
async def base_product(
100-
async_session: AsyncSession, product_create_payload: dict, create_repo
100+
async_session: AsyncSession,
101+
product_create_payload: dict,
102+
get_rpm_repository,
103+
create_repo,
101104
) -> AsyncIterable[Product]:
102105
product = (
103106
(
@@ -151,6 +154,7 @@ async def user_product(
151154
user_product_create_payload: dict,
152155
create_repo,
153156
create_file_repository,
157+
get_rpm_repository,
154158
) -> AsyncIterable[Product]:
155159
product = (
156160
(

tests/fixtures/pulp.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,13 @@ async def func(*args, **kwargs):
302302
monkeypatch.setattr(PulpClient, "get_rpm_repository_by_params", func)
303303

304304

305+
@pytest.fixture
306+
def get_rpm_repository(monkeypatch):
307+
async def func(*args, **kwargs):
308+
return None
309+
monkeypatch.setattr(PulpClient, "get_rpm_repository", func)
310+
311+
305312
@pytest.fixture
306313
def create_log_repo(monkeypatch):
307314
async def func(*args, **kwargs):

tests/test_api/test_products.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ async def test_product_create(
1717
self,
1818
product_create_payload,
1919
create_file_repository,
20+
get_rpm_repository,
2021
):
2122
response = await self.make_request(
2223
"post",
@@ -33,6 +34,7 @@ async def test_add_platfroms_to_product(
3334
self,
3435
user_product: Product,
3536
add_platfroms_to_product_payload,
37+
get_rpm_repository,
3638
):
3739
endpoint = f"/api/v1/products/{user_product.id}/add-platforms/"
3840
response = await self.make_request(

0 commit comments

Comments
 (0)