Skip to content

Commit be39a1e

Browse files
committed
fix tests to not use telnetlib
1 parent ad1f724 commit be39a1e

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

integration_tests/sonar/test_sonar_use_secure_protocols.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ class TestSonarUseSecureProtocols(SonarIntegrationTest):
1010
code_path = "tests/samples/use_secure_protocols.py"
1111
replacement_lines = [
1212
(
13-
5,
13+
4,
1414
"""url = "https://example.com"\n""",
1515
),
1616
]
1717
# fmt: off
1818
expected_diff = (
1919
"""--- \n"""
2020
"""+++ \n"""
21-
"""@@ -2,4 +2,4 @@\n"""
21+
"""@@ -1,4 +1,4 @@\n"""
22+
''' import ftplib\n'''
2223
''' import smtplib\n'''
23-
''' import telnetlib\n'''
2424
''' \n'''
2525
'''-url = "http://example.com"\n'''
2626
'''+url = "https://example.com"\n'''
2727
)
2828
# fmt: on
29-
expected_line_change = "5"
29+
expected_line_change = "4"
3030
change_description = SonarUseSecureProtocolsTransformer.change_description

tests/samples/sonar_hotspots.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@
136136
"securityCategory": "encrypt-data",
137137
"vulnerabilityProbability": "LOW",
138138
"status": "TO_REVIEW",
139-
"line": 5,
139+
"line": 4,
140140
"message": "Using http protocol is insecure. Use https instead",
141141
"creationDate": "2025-01-22T13:20:10+0100",
142142
"updateDate": "2025-01-22T13:29:45+0100",
143143
"textRange": {
144-
"startLine": 5,
145-
"endLine": 5,
144+
"startLine": 4,
145+
"endLine": 4,
146146
"startOffset": 6,
147147
"endOffset": 26
148148
},
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import ftplib
22
import smtplib
3-
import telnetlib
43

54
url = "http://example.com"

0 commit comments

Comments
 (0)