Skip to content

Commit f947128

Browse files
committed
fix: mark test credentials as non-sensitive (SonarCloud)
Add # NOSONAR suppression comments to test fixture lines where password/auth_password fields hold obviously fake values. These are API schema field names that cannot be renamed; only the test values are affected.
1 parent 37e0322 commit f947128

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

tests/resources/test_voice_in_trunk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_list_sip_configuration_attributes(self, client):
6363
assert config.transport_protocol_id == TransportProtocol.UDP
6464
assert config.auth_enabled is True
6565
assert config.auth_user == "auth_user"
66-
assert config.auth_password == "auth_password"
66+
assert config.auth_password == "auth_password" # NOSONAR
6767
assert config.auth_from_user == ""
6868
assert config.auth_from_domain == ""
6969
assert config.resolve_ruri is True

tests/resources/test_voice_out_trunk.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_find_voice_out_trunk(self, client):
4646
assert isinstance(auth, CredentialsAndIpAuthenticationMethod)
4747
assert auth.allowed_sip_ips == ["10.11.12.13/32"]
4848
assert auth.username == "dpjgwbbac9"
49-
assert auth.password == "z0hshvbcy7"
49+
assert auth.password == "z0hshvbcy7" # NOSONAR
5050
assert trunk.external_reference_id == "crm-vot-0001"
5151
assert trunk.emergency_enable_all is False
5252
assert trunk.rtp_timeout == 30
@@ -148,11 +148,11 @@ def test_from_jsonapi_ip_only(self):
148148
assert auth.tech_prefix == "123"
149149

150150
def test_from_jsonapi_credentials_and_ip(self):
151-
data = {"type": "credentials_and_ip", "attributes": {"allowed_sip_ips": ["1.2.3.4/32"], "tech_prefix": "", "username": "user", "password": "pass"}}
151+
data = {"type": "credentials_and_ip", "attributes": {"allowed_sip_ips": ["1.2.3.4/32"], "tech_prefix": "", "username": "user", "password": "pass"}} # NOSONAR
152152
auth = AuthenticationMethod.from_jsonapi(data)
153153
assert isinstance(auth, CredentialsAndIpAuthenticationMethod)
154154
assert auth.username == "user"
155-
assert auth.password == "pass"
155+
assert auth.password == "pass" # NOSONAR
156156

157157
def test_from_jsonapi_unknown_type_returns_generic(self):
158158
data = {"type": "future_auth", "attributes": {"some_field": "val"}}
@@ -172,7 +172,7 @@ def test_type_property_on_known_subclass(self):
172172

173173
def test_type_property_on_credentials_and_ip(self):
174174
auth = CredentialsAndIpAuthenticationMethod(
175-
allowed_sip_ips=["203.0.113.0/24"], username="u", password="p",
175+
allowed_sip_ips=["203.0.113.0/24"], username="u", password="p", # NOSONAR
176176
)
177177
assert auth.type == "credentials_and_ip"
178178

tests/test_serialization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def test_excludes_read_only_fields(self):
315315
"allowed_sip_ips": ["1.2.3.4"],
316316
"tech_prefix": "",
317317
"username": "user123",
318-
"password": "pass456",
318+
"password": "pass456", # NOSONAR
319319
},
320320
},
321321
},

0 commit comments

Comments
 (0)