File: __init__.py

package info (click to toggle)
python-gvm 26.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,132 kB
  • sloc: python: 44,662; makefile: 18
file content (29 lines) | stat: -rw-r--r-- 805 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# SPDX-FileCopyrightText: 2018-2024 Greenbone AG
#
# SPDX-License-Identifier: GPL-3.0-or-later
#

import unittest
from typing import Any, Type

from gvm.protocols._protocol import GvmProtocol
from tests import CallableMock


class MockConnection:
    def __init__(self):
        self.connect = CallableMock("connect")
        self.disconnect = CallableMock("disconnect")
        self.send = CallableMock("send")
        self.read = CallableMock("read")
        self.read.return_value(b'<foo_response status="200"/>')
        self.finish_send = CallableMock("finish_send")


class GmpTestCase(unittest.TestCase):
    gmp_class: Type[GvmProtocol[Any]]

    def setUp(self):
        self.connection = MockConnection()
        # pylint: disable=not-callable
        self.gmp = self.gmp_class(self.connection)