Completed
Push — master ( d25908...a5919a )
by
unknown
11s
created

tests.test_gmp_protocol.GMPCreateReportCommandTestCase.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 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...
28
    TARGET_NAME = 'Unittest Target'
29
    TARGET_HOST = '127.0.0.1'
30
    COMMENT = 'This is a comment'
31
    UUID = '00000000-0000-0000-0000-000000000000'
32
    PORT = '1234'
33
    ALIVE_TEST = 'ICMP Ping'
34
    PORT_RANGE = 'T:10-20,U:10-30'
35
36
    def setUp(self):
37
        self.gmp = _gmp()
38
39
    def tearDown(self):
40
        pass
41
42
    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...
43
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
44
                                           True,
45
                                           {'hosts': self.TARGET_HOST})
46
47
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
48
                         '<make_unique>1</make_unique></name>'
49
                         '<hosts>' + self.TARGET_HOST + '</hosts>'
50
                         '</create_target>', cmd)
51
52
    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...
53
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
54
                                           False,
55
                                           {'hosts': self.TARGET_HOST})
56
57
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
58
                         '<make_unique>0</make_unique></name>'
59
                         '<hosts>' + self.TARGET_HOST + '</hosts>'
60
                         '</create_target>', cmd)
61
62
    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...
63
        with self.assertRaises(ValueError) as context:
64
            self.gmp.createTargetCommand("", True, {'hosts': self.TARGET_HOST})
65
66
        self.assertEqual('create_target requires a name element',
67
                         str(context.exception))
68
69
    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...
70
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
71
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
72
                {'asset_hosts': {'filter': self.TARGET_HOST}})
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
73
74
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
75
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
76
                '<asset_hosts filter="' + self.TARGET_HOST + '"/>'
77
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
78
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
79
80
    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...
81
        with self.assertRaises(ValueError) as context:
82
            self.gmp.createTargetCommand(self.TARGET_NAME, True, {})
83
84
        self.assertEqual('create_target requires either a hosts or '
85
                         'an asset_hosts element',
86
                         str(context.exception))
87
88
    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...
89
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
90
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
91
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
92
                    'hosts': self.TARGET_HOST,
93
                    'comment': self.COMMENT
94
                    })
95
96
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
97
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
98
                '<hosts>' + self.TARGET_HOST + '</hosts>'
99
                '<comment>' + self.COMMENT + '</comment>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
100
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
101
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
102
103
    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...
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
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
107
                    'hosts': self.TARGET_HOST,
108
                    'copy': self.UUID
109
                    })
110
111
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
112
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
113
                '<hosts>' + self.TARGET_HOST + '</hosts>'
114
                '<copy>' + self.UUID + '</copy>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
115
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
116
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
117
118
    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...
119
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
120
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
121
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
122
                    'hosts': self.TARGET_HOST,
123
                    'exclude_hosts': self.TARGET_HOST
124
                    })
125
126
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
127
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
128
                '<hosts>' + self.TARGET_HOST + '</hosts>'
129
                '<exclude_hosts>' + self.TARGET_HOST + '</exclude_hosts>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
130
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
131
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
132
133
    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...
134
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
135
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
136
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
137
                    'hosts': self.TARGET_HOST,
138
                    'ssh_credential':
139
                    {
140
                        'id': self.UUID
141
                        }
142
                    })
143
144
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
145
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
146
                '<hosts>' + self.TARGET_HOST + '</hosts>'
147
                '<ssh_credential id="' + self.UUID + '"></ssh_credential>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
148
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
149
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
150
151
    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...
152
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
153
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
154
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
155
                    'hosts': self.TARGET_HOST,
156
                    'ssh_credential':
157
                    {
158
                        'id': self.UUID,
159
                        'port': self.PORT
160
                        }
161
                    })
162
163
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
164
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
165
                '<hosts>' + self.TARGET_HOST + '</hosts>'
166
                '<ssh_credential id="' + self.UUID + '">'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
167
                '<port>' + self.PORT + '</port></ssh_credential>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
168
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
169
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
170
171
    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...
172
        with self.assertRaises(ValueError) as context:
173
            self.gmp.createTargetCommand(self.TARGET_NAME,
174
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
175
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
176
                    'hosts': self.TARGET_HOST,
177
                    'ssh_credential': {}
178
                    })
179
180
        self.assertEqual('ssh_credential requires an id attribute',
181
                str(context.exception))
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
182
183
    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...
184
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
185
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
186
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
187
                    'hosts': self.TARGET_HOST,
188
                    'smb_credential':
189
                    {
190
                        'id': self.UUID
191
                        }
192
                    })
193
194
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
195
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
196
                '<hosts>' + self.TARGET_HOST + '</hosts>'
197
                '<smb_credential id="' + self.UUID + '"/>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
198
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
199
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
200
201
    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...
202
        with self.assertRaises(ValueError) as context:
203
            self.gmp.createTargetCommand(self.TARGET_NAME,
204
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
205
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
206
                    'hosts': self.TARGET_HOST,
207
                    'smb_credential': {}
208
                    })
209
210
        self.assertEqual('smb_credential requires an id attribute',
211
                str(context.exception))
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
212
213
    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...
214
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
215
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
216
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
217
                    'hosts': self.TARGET_HOST,
218
                    'esxi_credential':
219
                    {
220
                        'id': self.UUID
221
                        }
222
                    })
223
224
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
225
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
226
                '<hosts>' + self.TARGET_HOST + '</hosts>'
227
                '<esxi_credential id="' + self.UUID + '"/>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
228
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
229
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
230
231
    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...
232
        with self.assertRaises(ValueError) as context:
233
            self.gmp.createTargetCommand(self.TARGET_NAME,
234
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
235
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
236
                    'hosts': self.TARGET_HOST,
237
                    'esxi_credential': {}
238
                    })
239
240
        self.assertEqual('esxi_credential requires an id attribute',
241
                str(context.exception))
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
242
243
    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...
244
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
245
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
246
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
247
                    'hosts': self.TARGET_HOST,
248
                    'snmp_credential':
249
                    {
250
                        'id': self.UUID
251
                        }
252
                    })
253
254
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
255
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
256
                '<hosts>' + self.TARGET_HOST + '</hosts>'
257
                '<snmp_credential id="' + self.UUID + '"/>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
258
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
259
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
260
261
    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...
262
        with self.assertRaises(ValueError) as context:
263
            self.gmp.createTargetCommand(self.TARGET_NAME,
264
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
265
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
266
                    'hosts': self.TARGET_HOST,
267
                    'snmp_credential': {}
268
                    })
269
270
        self.assertEqual('snmp_credential requires an id attribute',
271
                str(context.exception))
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
272
273
    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...
274
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
275
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
276
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
277
                    'hosts': self.TARGET_HOST,
278
                    'alive_tests': self.ALIVE_TEST
279
                    })
280
281
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
282
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
283
                '<hosts>' + self.TARGET_HOST + '</hosts>'
284
                '<alive_tests>' + self.ALIVE_TEST + '</alive_tests>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
285
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
286
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
287
288
    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...
289
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
290
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
291
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
292
                    'hosts': self.TARGET_HOST,
293
                    'reverse_lookup_only': True
294
                    })
295
296
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
297
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
298
                '<hosts>' + self.TARGET_HOST + '</hosts>'
299
                '<reverse_lookup_only>1</reverse_lookup_only>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
300
                '</create_target>',
301
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
302
303
    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...
304
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
305
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
306
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
307
                    'hosts': self.TARGET_HOST,
308
                    'reverse_lookup_only': False
309
                    })
310
311
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
312
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
313
                '<hosts>' + self.TARGET_HOST + '</hosts>'
314
                '<reverse_lookup_only>0</reverse_lookup_only>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
315
                '</create_target>',
316
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
317
318
    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...
319
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
320
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
321
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
322
                    'hosts': self.TARGET_HOST,
323
                    'reverse_lookup_unify': True
324
                    })
325
326
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
327
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
328
                '<hosts>' + self.TARGET_HOST + '</hosts>'
329
                '<reverse_lookup_unify>1</reverse_lookup_unify>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
330
                '</create_target>',
331
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
332
333
    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...
334
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
335
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
336
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
337
                    'hosts': self.TARGET_HOST,
338
                    'reverse_lookup_unify': False
339
                    })
340
341
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
342
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
343
                '<hosts>' + self.TARGET_HOST + '</hosts>'
344
                '<reverse_lookup_unify>0</reverse_lookup_unify>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
345
                '</create_target>',
346
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
347
348
    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...
349
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
350
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
351
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
352
                    'hosts': self.TARGET_HOST,
353
                    'port_range': self.PORT_RANGE
354
                    })
355
356
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
357
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
358
                '<hosts>' + self.TARGET_HOST + '</hosts>'
359
                '<port_range>' + self.PORT_RANGE + '</port_range>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
360
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
361
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
362
363
    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...
364
        cmd = self.gmp.createTargetCommand(self.TARGET_NAME,
365
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
366
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 27 spaces).
Loading history...
367
                    'hosts': self.TARGET_HOST,
368
                    'port_list':
369
                    {
370
                        'id': self.UUID
371
                        }
372
                    })
373
374
        self.assertEqual('<create_target><name>' + self.TARGET_NAME +
375
                '<make_unique>1</make_unique></name>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
376
                '<hosts>' + self.TARGET_HOST + '</hosts>'
377
                '<port_list id="' + self.UUID + '"/>'
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
378
                '</create_target>',
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation.
Loading history...
379
                cmd)
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
380
381
    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...
382
        with self.assertRaises(ValueError) as context:
383
            self.gmp.createTargetCommand(self.TARGET_NAME,
384
                True,
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
385
                {
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 25 spaces).
Loading history...
386
                    'hosts': self.TARGET_HOST,
387
                    'port_list': {}
388
                    })
389
390
        self.assertEqual('port_list requires an id attribute',
391
                str(context.exception))
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 9 spaces).
Loading history...
392
393
394
class GMPCreateReportCommandTestCase(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...
395
    TASK_ID = '00000000-0000-0000-0000-000000000001'
396
    TASK_NAME = 'unit test task'
397
    COMMENT = 'This is a comment'
398
    REPORT_XML_STRING = (
399
        '<report id="67a62fb7-b238-4f0e-bc48-59bde8939cdc"><results max="1"' +
400
        ' start="1"><result id="f180b40f-49dd-4856-81ed-8c1195afce80">' +
401
        '<severity>0.0</severity><nvt oid="1.3.6.1.4.1.25623.1.0.10330"/>' +
402
        '<host>132.67.253.114</host></result></results></report>'
403
    )
404
405
    def setUp(self):
406
        self.gmp = _gmp()
407
408
    def tearDown(self):
409
        pass
410
411
    def test_Create_ReportCmd_Taskid(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_Create_ReportCmd_Taskid 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...
412
        cmd = self.gmp.createReportCommand(self.REPORT_XML_STRING,
413
                                           {
414
                                               'task_id': self.TASK_ID,
415
                                           })
416
417
        self.assertEqual('<create_report><task id="' + self.TASK_ID + '"/>' +
418
                         self.REPORT_XML_STRING + '</create_report>',
419
                         cmd)
420
421
    def test_Create_ReportCmd_Taskname(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_Create_ReportCmd_Taskname 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...
422
        cmd = self.gmp.createReportCommand(self.REPORT_XML_STRING,
423
                                           {
424
                                               'task_name': self.TASK_NAME,
425
                                               'comment': self.COMMENT,
426
                                           })
427
428
        self.assertEqual('<create_report><task>' +
429
                         '<name>' + self.TASK_NAME + '</name>' +
430
                         '<comment>' + self.COMMENT + '</comment>' +
431
                         '</task>' + self.REPORT_XML_STRING + '</create_report>',
432
                         cmd)
433
434
    def test_Create_ReportCmd_noreport(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_Create_ReportCmd_noreport 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...
435
        NO_REPORT = None
0 ignored issues
show
Coding Style Naming introduced by
The name NO_REPORT does not conform to the variable 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...
436
        args = {
437
            'task_name': self.TASK_NAME,
438
            'comment': self.COMMENT,
439
        }
440
441
        self.assertRaises(ValueError,
442
                          self.gmp.createReportCommand,
443
                          NO_REPORT,
444
                          args
445
        )
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 17 spaces).
Loading history...
446
447
    def test_Create_ReportCmd_notask(self):
0 ignored issues
show
Coding Style Naming introduced by
The name test_Create_ReportCmd_notask 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...
448
        args = {'comment': self.COMMENT}
449
        self.assertRaises(ValueError,
450
                          self.gmp.createReportCommand,
451
                          self.REPORT_XML_STRING,
452
                          args
453
        )
0 ignored issues
show
Coding Style introduced by
Wrong continued indentation (add 17 spaces).
Loading history...
454
455
if __name__ == '__main__':
456
    unittest.main()
457