Passed
Pull Request — master (#59)
by
unknown
12:01
created

tests.test_gmp_protocol.GMPCreateTaskCommandTestCase.setUp()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
0 ignored issues
show
Coding Style introduced by
This module should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
2
# Description:
3
# Testcases to test gmp protocol
4
#
5
# Authors:
6
# Michael Wiegand <[email protected]>
7
#
8
# Copyright:
9
# Copyright (C) 2018 Greenbone Networks GmbH
10
#
11
# This program is free software: you can redistribute it and/or modify
12
# it under the terms of the GNU General Public License as published by
13
# the Free Software Foundation, either version 3 of the License, or
14
# (at your option) any later version.
15
#
16
# This program is distributed in the hope that it will be useful,
17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
# GNU General Public License for more details.
20
#
21
# You should have received a copy of the GNU General Public License
22
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
23
24
import unittest
25
from gmp.gmp import _gmp
26
27
class GMPCreateTaskCommandTestCase(unittest.TestCase):
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
28
29
    TASK_NAME = "important task"
30
    CONFIG_ID = "cd0641e7-40b8-4e2c-811e-6b39d6d4b904"
31
    TARGET_ID = '267a3405-e84a-47da-97b2-5fa0d2e8995e'
32
    SCANNER_ID = 'b64c81b2-b9de-11e3-a2e9-406186ea4fc5'
33
    ALERT_ID = '3ab38c6a-30ac-407a-98db-ad6e74c98b9a'
34
    COMMENT = 'this task has been created for test purposes'
35
36
    def setUp(self):
37
        self.gmp = _gmp()
38
39
    def test_SingleAlert_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_SingleAlert_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
40
        cmd = self.gmp.createTaskCommand(
41
            self.TASK_NAME, self.CONFIG_ID, self.TARGET_ID, self.SCANNER_ID,self.ALERT_ID, self.COMMENT)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (104/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
Coding Style introduced by
Exactly one space required after comma
Loading history...
42
43
        self.assertEqual('<create_task><name>{0}</name><comment>{1}</comment>' \
44
                         '<config id="{2}"/><target id="{3}"/><scanner id="{4}"/>' \
45
                         '<alert id="{5}"/></create_task>'.format(self.TASK_NAME, 
0 ignored issues
show
Coding Style introduced by
Trailing whitespace
Loading history...
46
                         self.COMMENT, self.CONFIG_ID, self.TARGET_ID, self.SCANNER_ID, self.ALERT_ID), cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 41 spaces).
Loading history...
Coding Style introduced by
This line is too long as per the coding-style (108/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
47
48
    def test_MultipleAlerts_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_MultipleAlerts_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
49
        alert_id2 = 'fb3d6f82-d706-4f99-9e53-d7d85257e25f'
50
        alert_id3 = 'a33864a9-d3fd-44b3-8717-972bfb01dfcf'
51
        alert_ids = [self.ALERT_ID, alert_id2, alert_id3]
52
        cmd = self.gmp.createTaskCommand(
53
            self.TASK_NAME, self.CONFIG_ID, self.TARGET_ID, self.SCANNER_ID, alert_ids, self.COMMENT)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (101/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
54
        self.assertEqual('<create_task><name>{0}</name><comment>{1}</comment>' \
55
                         '<config id="{2}"/><target id="{3}"/><scanner id="{4}"/>' \
56
                         '<alert id="{5}"/><alert id="{6}"/><alert id="{7}"/>' \
57
                         '</create_task>'.format(self.TASK_NAME, 
0 ignored issues
show
Coding Style introduced by
Trailing whitespace
Loading history...
58
                         self.COMMENT, self.CONFIG_ID, self.TARGET_ID, self.SCANNER_ID, self.ALERT_ID, 
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 24 spaces).
Loading history...
Coding Style introduced by
Trailing whitespace
Loading history...
Coding Style introduced by
This line is too long as per the coding-style (102/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
59
                         alert_id2, alert_id3), cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 24 spaces).
Loading history...
60
61
class GMPCreateTargetCommandTestCase(unittest.TestCase):
0 ignored issues
show
Coding Style introduced by
This class should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
best-practice introduced by
Too many public methods (27/20)
Loading history...
62
    TARGET_NAME = 'Unittest Target'
63
    TARGET_HOST = '127.0.0.1'
64
    COMMENT = 'This is a comment'
65
    UUID = '00000000-0000-0000-0000-000000000000'
66
    PORT = '1234'
67
    ALIVE_TEST = 'ICMP Ping'
68
    PORT_RANGE = 'T:10-20,U:10-30'
69
70
    def setUp(self):
71
        self.gmp = _gmp()
72
73
    def tearDown(self):
74
        pass
75
76
    def test_ValidNameMakeUniqueTrue_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_ValidNameMakeUniqueTrue_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
77
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
78
                                           True,
79
                                           {'hosts': self.TARGET_HOST})
80
81
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
82
                         '<make_unique>1</make_unique></name>'
83
                         '<hosts>' + self.TARGET_HOST + '</hosts>'
84
                         '</create_target>', cmd)
85
86
    def test_ValidNameMakeUniqueFalse_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_ValidNameMakeUniqueFalse_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
87
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
88
                                           False,
89
                                           {'hosts': self.TARGET_HOST})
90
91
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
92
                         '<make_unique>0</make_unique></name>'
93
                         '<hosts>' + self.TARGET_HOST + '</hosts>'
94
                         '</create_target>', cmd)
95
96
    def test_EmptyName_ValueError(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_EmptyName_ValueError does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
97
        with self.assertRaises(ValueError) as context:
98
            self.gmp.createTargetCommand("", True, {'hosts': self.TARGET_HOST})
99
100
        self.assertEqual('create_target requires a name element',
101
                         str(context.exception))
102
103
    def test_AssetHosts_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_AssetHosts_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
104
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
105
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
106
                {'asset_hosts': {'filter': self.TARGET_HOST}})
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
107
108
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
109
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
110
                '<asset_hosts filter="' + self.TARGET_HOST + '"/>'
111
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
112
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
113
114
    def test_NoHostNoAssetHosts_ValueError(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_NoHostNoAssetHosts_ValueError does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
115
        with self.assertRaises(ValueError) as context:
116
            self.gmp.createTargetCommand(self.TARGET_NAME, True, {})
117
118
        self.assertEqual('create_target requires either a hosts or '
119
                         'an asset_hosts element',
120
                         str(context.exception))
121
122
    def test_Comment_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_Comment_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
123
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
124
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
125
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
126
                    'hosts': self.TARGET_HOST,
127
                    'comment': self.COMMENT
128
                    })
129
130
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
131
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
132
                '<hosts>' + self.TARGET_HOST + '</hosts>'
133
                '<comment>' + self.COMMENT + '</comment>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
134
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
135
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
136
137
    def test_Copy_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_Copy_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
138
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
139
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
140
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
141
                    'hosts': self.TARGET_HOST,
142
                    'copy': self.UUID
143
                    })
144
145
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
146
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
147
                '<hosts>' + self.TARGET_HOST + '</hosts>'
148
                '<copy>' + self.UUID + '</copy>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
149
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
150
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
151
152
    def test_ExcludeHosts_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_ExcludeHosts_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
153
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
154
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
155
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
156
                    'hosts': self.TARGET_HOST,
157
                    'exclude_hosts': self.TARGET_HOST
158
                    })
159
160
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
161
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
162
                '<hosts>' + self.TARGET_HOST + '</hosts>'
163
                '<exclude_hosts>' + self.TARGET_HOST + '</exclude_hosts>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
164
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
165
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
166
167
    def test_SSHCredential_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_SSHCredential_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
168
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
169
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
170
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
171
                    'hosts': self.TARGET_HOST,
172
                    'ssh_credential':
173
                    {
174
                        'id': self.UUID
175
                        }
176
                    })
177
178
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
179
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
180
                '<hosts>' + self.TARGET_HOST + '</hosts>'
181
                '<ssh_credential id="' + self.UUID + '"></ssh_credential>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
182
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
183
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
184
185
    def test_SSHCredentialWithPort_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_SSHCredentialWithPort_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
186
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
187
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
188
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
189
                    'hosts': self.TARGET_HOST,
190
                    'ssh_credential':
191
                    {
192
                        'id': self.UUID,
193
                        'port': self.PORT
194
                        }
195
                    })
196
197
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
198
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
199
                '<hosts>' + self.TARGET_HOST + '</hosts>'
200
                '<ssh_credential id="' + self.UUID + '">'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
201
                '<port>' + self.PORT + '</port></ssh_credential>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
202
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
203
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
204
205
    def test_SSHCredentialNoID_ValueError(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_SSHCredentialNoID_ValueError does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
206
        with self.assertRaises(ValueError) as context:
207
            self.gmp.createTargetCommand(self.TARGET_NAME,
208
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
209
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
210
                    'hosts': self.TARGET_HOST,
211
                    'ssh_credential': {}
212
                    })
213
214
        self.assertEqual('ssh_credential requires an id attribute',
215
                str(context.exception))
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
216
217
    def test_SMBCredential_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_SMBCredential_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
218
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
219
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
220
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
221
                    'hosts': self.TARGET_HOST,
222
                    'smb_credential':
223
                    {
224
                        'id': self.UUID
225
                        }
226
                    })
227
228
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
229
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
230
                '<hosts>' + self.TARGET_HOST + '</hosts>'
231
                '<smb_credential id="' + self.UUID + '"/>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
232
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
233
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
234
235
    def test_SMBCredentialNoID_ValueError(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_SMBCredentialNoID_ValueError does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
236
        with self.assertRaises(ValueError) as context:
237
            self.gmp.createTargetCommand(self.TARGET_NAME,
238
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
239
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
240
                    'hosts': self.TARGET_HOST,
241
                    'smb_credential': {}
242
                    })
243
244
        self.assertEqual('smb_credential requires an id attribute',
245
                str(context.exception))
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
246
247
    def test_ESXiCredential_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_ESXiCredential_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
248
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
249
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
250
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
251
                    'hosts': self.TARGET_HOST,
252
                    'esxi_credential':
253
                    {
254
                        'id': self.UUID
255
                        }
256
                    })
257
258
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
259
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
260
                '<hosts>' + self.TARGET_HOST + '</hosts>'
261
                '<esxi_credential id="' + self.UUID + '"/>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
262
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
263
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
264
265
    def test_ESXiCredentialNoID_ValueError(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_ESXiCredentialNoID_ValueError does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
266
        with self.assertRaises(ValueError) as context:
267
            self.gmp.createTargetCommand(self.TARGET_NAME,
268
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
269
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
270
                    'hosts': self.TARGET_HOST,
271
                    'esxi_credential': {}
272
                    })
273
274
        self.assertEqual('esxi_credential requires an id attribute',
275
                str(context.exception))
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
276
277
    def test_SNMPCredential_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_SNMPCredential_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
278
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
279
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
280
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
281
                    'hosts': self.TARGET_HOST,
282
                    'snmp_credential':
283
                    {
284
                        'id': self.UUID
285
                        }
286
                    })
287
288
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
289
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
290
                '<hosts>' + self.TARGET_HOST + '</hosts>'
291
                '<snmp_credential id="' + self.UUID + '"/>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
292
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
293
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
294
295
    def test_SNMPCredentialNoID_ValueError(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_SNMPCredentialNoID_ValueError does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
296
        with self.assertRaises(ValueError) as context:
297
            self.gmp.createTargetCommand(self.TARGET_NAME,
298
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
299
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
300
                    'hosts': self.TARGET_HOST,
301
                    'snmp_credential': {}
302
                    })
303
304
        self.assertEqual('snmp_credential requires an id attribute',
305
                str(context.exception))
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
306
307
    def test_AliveTests_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_AliveTests_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
308
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
309
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
310
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
311
                    'hosts': self.TARGET_HOST,
312
                    'alive_tests': self.ALIVE_TEST
313
                    })
314
315
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
316
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
317
                '<hosts>' + self.TARGET_HOST + '</hosts>'
318
                '<alive_tests>' + self.ALIVE_TEST + '</alive_tests>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
319
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
320
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
321
322
    def test_ReverseLookupOnlyTrue_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_ReverseLookupOnlyTrue_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
323
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
324
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
325
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
326
                    'hosts': self.TARGET_HOST,
327
                    'reverse_lookup_only': True
328
                    })
329
330
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
331
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
332
                '<hosts>' + self.TARGET_HOST + '</hosts>'
333
                '<reverse_lookup_only>1</reverse_lookup_only>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
334
                '</create_target>',
335
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
336
337
    def test_ReverseLookupOnlyFalse_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_ReverseLookupOnlyFalse_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
338
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
339
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
340
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
341
                    'hosts': self.TARGET_HOST,
342
                    'reverse_lookup_only': False
343
                    })
344
345
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
346
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
347
                '<hosts>' + self.TARGET_HOST + '</hosts>'
348
                '<reverse_lookup_only>0</reverse_lookup_only>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
349
                '</create_target>',
350
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
351
352
    def test_ReverseLookupUnifyTrue_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_ReverseLookupUnifyTrue_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
353
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
354
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
355
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
356
                    'hosts': self.TARGET_HOST,
357
                    'reverse_lookup_unify': True
358
                    })
359
360
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
361
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
362
                '<hosts>' + self.TARGET_HOST + '</hosts>'
363
                '<reverse_lookup_unify>1</reverse_lookup_unify>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
364
                '</create_target>',
365
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
366
367
    def test_ReverseLookupUnifyFalse_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_ReverseLookupUnifyFalse_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
368
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
369
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
370
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
371
                    'hosts': self.TARGET_HOST,
372
                    'reverse_lookup_unify': False
373
                    })
374
375
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
376
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
377
                '<hosts>' + self.TARGET_HOST + '</hosts>'
378
                '<reverse_lookup_unify>0</reverse_lookup_unify>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
379
                '</create_target>',
380
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
381
382
    def test_PortRange_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_PortRange_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
383
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
384
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
385
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
386
                    'hosts': self.TARGET_HOST,
387
                    'port_range': self.PORT_RANGE
388
                    })
389
390
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
391
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
392
                '<hosts>' + self.TARGET_HOST + '</hosts>'
393
                '<port_range>' + self.PORT_RANGE + '</port_range>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
394
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
395
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
396
397
    def test_PortList_CorrectCmd(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_PortList_CorrectCmd does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
398
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
399
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
400
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
401
                    'hosts': self.TARGET_HOST,
402
                    'port_list':
403
                    {
404
                        'id': self.UUID
405
                        }
406
                    })
407
408
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
409
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
410
                '<hosts>' + self.TARGET_HOST + '</hosts>'
411
                '<port_list id="' + self.UUID + '"/>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
412
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
413
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
414
415
    def test_PortListNoID_ValueError(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_PortListNoID_ValueError does not conform to the method naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
416
        with self.assertRaises(ValueError) as context:
417
            self.gmp.createTargetCommand(self.TARGET_NAME,
418
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
419
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
420
                    'hosts': self.TARGET_HOST,
421
                    'port_list': {}
422
                    })
423
424
        self.assertEqual('port_list requires an id attribute',
425
                str(context.exception))
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
426
427
428
if __name__ == '__main__':
429
    unittest.main()
430