Passed
Push — master ( 1e243f...b519bb )
by Björn
197:44 queued 153:47
created

tests.protocols.gmpv208.entities.scan_configs.test_get_scan_configs   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 103
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 50
dl 0
loc 103
rs 10
c 0
b 0
f 0
wmc 12

12 Methods

Rating   Name   Duplication   Size   Complexity  
A GmpGetScanConfigsTestMixin.test_get_scan_configs_without_tasks() 0 5 1
A GmpGetScanConfigsTestMixin.test_get_scan_configs_with_tasks() 0 5 1
A GmpGetScanConfigsTestMixin.test_get_scan_configs_with_filter_id() 0 5 1
A GmpGetScanConfigsTestMixin.test_get_scan_configs_with_details() 0 5 1
A GmpGetScanConfigsTestMixin.test_get_scan_configs_simple() 0 5 1
A GmpGetScanConfigsTestMixin.test_get_scan_configs_from_trash() 0 5 1
A GmpGetScanConfigsTestMixin.test_get_scan_configs_with_families() 0 5 1
A GmpGetScanConfigsTestMixin.test_get_scan_configs_without_families() 0 5 1
A GmpGetScanConfigsTestMixin.test_get_scan_configs_without_details() 0 5 1
A GmpGetScanConfigsTestMixin.test_get_scan_configs_without_preferences() 0 5 1
A GmpGetScanConfigsTestMixin.test_get_scan_configs_with_filter() 0 5 1
A GmpGetScanConfigsTestMixin.test_get_scan_configs_with_preferences() 0 5 1
1
# -*- coding: utf-8 -*-
2
# Copyright (C) 2018-2021 Greenbone Networks GmbH
3
#
4
# SPDX-License-Identifier: GPL-3.0-or-later
5
#
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19
20
class GmpGetScanConfigsTestMixin:
21
    def test_get_scan_configs_simple(self):
22
        self.gmp.get_scan_configs()
23
24
        self.connection.send.has_been_called_with(
25
            '<get_configs usage_type="scan"/>'
26
        )
27
28
    def test_get_scan_configs_with_filter(self):
29
        self.gmp.get_scan_configs(filter='name=foo')
30
31
        self.connection.send.has_been_called_with(
32
            '<get_configs usage_type="scan" filter="name=foo"/>'
33
        )
34
35
    def test_get_scan_configs_with_filter_id(self):
36
        self.gmp.get_scan_configs(filter_id='f1')
37
38
        self.connection.send.has_been_called_with(
39
            '<get_configs usage_type="scan" filt_id="f1"/>'
40
        )
41
42
    def test_get_scan_configs_from_trash(self):
43
        self.gmp.get_scan_configs(trash=True)
44
45
        self.connection.send.has_been_called_with(
46
            '<get_configs usage_type="scan" trash="1"/>'
47
        )
48
49
    def test_get_scan_configs_with_details(self):
50
        self.gmp.get_scan_configs(details=True)
51
52
        self.connection.send.has_been_called_with(
53
            '<get_configs usage_type="scan" details="1"/>'
54
        )
55
56
    def test_get_scan_configs_without_details(self):
57
        self.gmp.get_scan_configs(details=False)
58
59
        self.connection.send.has_been_called_with(
60
            '<get_configs usage_type="scan" details="0"/>'
61
        )
62
63
    def test_get_scan_configs_with_families(self):
64
        self.gmp.get_scan_configs(families=True)
65
66
        self.connection.send.has_been_called_with(
67
            '<get_configs usage_type="scan" families="1"/>'
68
        )
69
70
    def test_get_scan_configs_without_families(self):
71
        self.gmp.get_scan_configs(families=False)
72
73
        self.connection.send.has_been_called_with(
74
            '<get_configs usage_type="scan" families="0"/>'
75
        )
76
77
    def test_get_scan_configs_with_preferences(self):
78
        self.gmp.get_scan_configs(preferences=True)
79
80
        self.connection.send.has_been_called_with(
81
            '<get_configs usage_type="scan" preferences="1"/>'
82
        )
83
84
    def test_get_scan_configs_without_preferences(self):
85
        self.gmp.get_scan_configs(preferences=False)
86
87
        self.connection.send.has_been_called_with(
88
            '<get_configs usage_type="scan" preferences="0"/>'
89
        )
90
91
    def test_get_scan_configs_with_tasks(self):
92
        self.gmp.get_scan_configs(tasks=True)
93
94
        self.connection.send.has_been_called_with(
95
            '<get_configs usage_type="scan" tasks="1"/>'
96
        )
97
98
    def test_get_scan_configs_without_tasks(self):
99
        self.gmp.get_scan_configs(tasks=False)
100
101
        self.connection.send.has_been_called_with(
102
            '<get_configs usage_type="scan" tasks="0"/>'
103
        )
104