Code Duplication    Length = 66-83 lines in 2 locations

tests/protocols/gmpv9/test_get_configs.py 1 location

@@ 24-106 (lines=83) @@
21
from . import Gmpv9TestCase
22
23
24
class GmpGetConfigsTestCase(Gmpv9TestCase):
25
    def test_get_configs_simple(self):
26
        self.gmp.get_configs()
27
28
        self.connection.send.has_been_called_with(
29
            '<get_configs usage_type="scan"/>'
30
        )
31
32
    def test_get_configs_with_filter(self):
33
        self.gmp.get_configs(filter='name=foo')
34
35
        self.connection.send.has_been_called_with(
36
            '<get_configs usage_type="scan" filter="name=foo"/>'
37
        )
38
39
    def test_get_configs_with_filter_id(self):
40
        self.gmp.get_configs(filter_id='f1')
41
42
        self.connection.send.has_been_called_with(
43
            '<get_configs usage_type="scan" filt_id="f1"/>'
44
        )
45
46
    def test_get_configs_from_trash(self):
47
        self.gmp.get_configs(trash=True)
48
49
        self.connection.send.has_been_called_with(
50
            '<get_configs usage_type="scan" trash="1"/>'
51
        )
52
53
    def test_get_configs_with_details(self):
54
        self.gmp.get_configs(details=True)
55
56
        self.connection.send.has_been_called_with(
57
            '<get_configs usage_type="scan" details="1"/>'
58
        )
59
60
    def test_get_configs_without_details(self):
61
        self.gmp.get_configs(details=False)
62
63
        self.connection.send.has_been_called_with(
64
            '<get_configs usage_type="scan" details="0"/>'
65
        )
66
67
    def test_get_configs_with_families(self):
68
        self.gmp.get_configs(families=True)
69
70
        self.connection.send.has_been_called_with(
71
            '<get_configs usage_type="scan" families="1"/>'
72
        )
73
74
    def test_get_configs_without_families(self):
75
        self.gmp.get_configs(families=False)
76
77
        self.connection.send.has_been_called_with(
78
            '<get_configs usage_type="scan" families="0"/>'
79
        )
80
81
    def test_get_configs_with_preferences(self):
82
        self.gmp.get_configs(preferences=True)
83
84
        self.connection.send.has_been_called_with(
85
            '<get_configs usage_type="scan" preferences="1"/>'
86
        )
87
88
    def test_get_configs_without_preferences(self):
89
        self.gmp.get_configs(preferences=False)
90
91
        self.connection.send.has_been_called_with(
92
            '<get_configs usage_type="scan" preferences="0"/>'
93
        )
94
95
    def test_get_configs_with_tasks(self):
96
        self.gmp.get_configs(tasks=True)
97
98
        self.connection.send.has_been_called_with(
99
            '<get_configs usage_type="scan" tasks="1"/>'
100
        )
101
102
    def test_get_configs_without_tasks(self):
103
        self.gmp.get_configs(tasks=False)
104
105
        self.connection.send.has_been_called_with(
106
            '<get_configs usage_type="scan" tasks="0"/>'
107
        )
108
109

tests/protocols/gmpv7/test_get_configs.py 1 location

@@ 24-89 (lines=66) @@
21
from . import Gmpv7TestCase
22
23
24
class GmpGetConfigsTestCase(Gmpv7TestCase):
25
    def test_get_configs_simple(self):
26
        self.gmp.get_configs()
27
28
        self.connection.send.has_been_called_with('<get_configs/>')
29
30
    def test_get_configs_with_filter(self):
31
        self.gmp.get_configs(filter='name=foo')
32
33
        self.connection.send.has_been_called_with(
34
            '<get_configs filter="name=foo"/>'
35
        )
36
37
    def test_get_configs_with_filter_id(self):
38
        self.gmp.get_configs(filter_id='f1')
39
40
        self.connection.send.has_been_called_with('<get_configs filt_id="f1"/>')
41
42
    def test_get_configs_from_trash(self):
43
        self.gmp.get_configs(trash=True)
44
45
        self.connection.send.has_been_called_with('<get_configs trash="1"/>')
46
47
    def test_get_configs_with_details(self):
48
        self.gmp.get_configs(details=True)
49
50
        self.connection.send.has_been_called_with('<get_configs details="1"/>')
51
52
    def test_get_configs_without_details(self):
53
        self.gmp.get_configs(details=False)
54
55
        self.connection.send.has_been_called_with('<get_configs details="0"/>')
56
57
    def test_get_configs_with_families(self):
58
        self.gmp.get_configs(families=True)
59
60
        self.connection.send.has_been_called_with('<get_configs families="1"/>')
61
62
    def test_get_configs_without_families(self):
63
        self.gmp.get_configs(families=False)
64
65
        self.connection.send.has_been_called_with('<get_configs families="0"/>')
66
67
    def test_get_configs_with_preferences(self):
68
        self.gmp.get_configs(preferences=True)
69
70
        self.connection.send.has_been_called_with(
71
            '<get_configs preferences="1"/>'
72
        )
73
74
    def test_get_configs_without_preferences(self):
75
        self.gmp.get_configs(preferences=False)
76
77
        self.connection.send.has_been_called_with(
78
            '<get_configs preferences="0"/>'
79
        )
80
81
    def test_get_configs_with_tasks(self):
82
        self.gmp.get_configs(tasks=True)
83
84
        self.connection.send.has_been_called_with('<get_configs tasks="1"/>')
85
86
    def test_get_configs_without_tasks(self):
87
        self.gmp.get_configs(tasks=False)
88
89
        self.connection.send.has_been_called_with('<get_configs tasks="0"/>')
90
91
92
if __name__ == '__main__':