Skip to content

Commit 002da44

Browse files
committed
testing my test_get_nosec test for the fixes to issue PyCQA#1003
1 parent 9dfee86 commit 002da44

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/unit/core/test_util.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,3 +342,21 @@ def test_check_ast_node_bad_node(self):
342342

343343
def test_check_ast_node_bad_type(self):
344344
self.assertRaises(TypeError, b_utils.check_ast_node, "walk")
345+
346+
def test_get_nosec(self):
347+
# prepare the input data
348+
nosec_lines = {
349+
3: ' aws_access_key_id=\'key_goes_here\',\n',
350+
4: ' aws_secret_access_key=\'secret_goes_here\',\n',
351+
5: ' endpoint_url=\'s3.amazonaws.com\',\n',
352+
7: '# nosec B108\n',
353+
8: '# nosec B108\n'
354+
}
355+
context = {
356+
'lineno': 0,
357+
'linerange': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
358+
}
359+
# execute the function being tested
360+
result = b_utils.get_nosec(nosec_lines, context)
361+
# assert that the expected result is returned
362+
self.assertEqual(result, "# nosec B106")

0 commit comments

Comments
 (0)