File: test_help.py

package info (click to toggle)
python-gvm 26.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,220 kB
  • sloc: python: 45,844; makefile: 18
file content (30 lines) | stat: -rw-r--r-- 811 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
30
# SPDX-FileCopyrightText: 2018-2024 Greenbone AG
#
# SPDX-License-Identifier: GPL-3.0-or-later
#

from gvm.errors import InvalidArgument
from gvm.protocols.gmp.requests.v224 import HelpFormat


class GmpHelpTestMixin:
    def test_help(self):
        self.gmp.help()

        self.connection.send.has_been_called_with(b'<help type=""/>')

    def test_help_type_brief(self):
        self.gmp.help(brief=True)

        self.connection.send.has_been_called_with(b'<help type="brief"/>')

    def test_invalid_help_format(self):
        with self.assertRaises(InvalidArgument):
            self.gmp.help(help_format="foo")

    def test_html_format(self):
        self.gmp.help(help_format=HelpFormat.HTML)

        self.connection.send.has_been_called_with(
            b'<help type="" format="html"/>'
        )