File: __init__.py

package info (click to toggle)
pontos 25.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,744 kB
  • sloc: python: 44,602; makefile: 21; sh: 10; xml: 3
file content (23 lines) | stat: -rw-r--r-- 613 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# SPDX-FileCopyrightText: 2022-2023 Greenbone AG
#
# SPDX-License-Identifier: GPL-3.0-or-later
#

from unittest.mock import MagicMock

import httpx

from pontos.github.api.client import GitHubAsyncREST, GitHubAsyncRESTClient
from tests import AsyncMock, IsolatedAsyncioTestCase


def create_response(*args, **kwargs) -> MagicMock:
    return MagicMock(spec=httpx.Response, *args, **kwargs)


class GitHubAsyncRESTTestCase(IsolatedAsyncioTestCase):
    api_cls = GitHubAsyncREST

    def setUp(self) -> None:
        self.client = AsyncMock(spec=GitHubAsyncRESTClient)
        self.api = self.api_cls(self.client)