From 7fab13ed937d27f7f622518859e589633b0ea75c Mon Sep 17 00:00:00 2001 From: ha-enthus1ast Date: Tue, 19 Dec 2023 11:08:44 +0000 Subject: [PATCH 1/3] Removed hardcoded username and password Signed-off-by: ha-enthus1ast --- tests/test_discoverable.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/tests/test_discoverable.py b/tests/test_discoverable.py index 1845cc8..e81c51a 100644 --- a/tests/test_discoverable.py +++ b/tests/test_discoverable.py @@ -35,9 +35,7 @@ @pytest.fixture def discoverable() -> Discoverable[EntityInfo]: - mqtt_settings = Settings.MQTT( - host="localhost", username="admin", password="password" - ) + mqtt_settings = Settings.MQTT(host="localhost") sensor_info = EntityInfo(name="test", component="binary_sensor") settings = Settings(mqtt=mqtt_settings, entity=sensor_info) return Discoverable[EntityInfo](settings) @@ -46,9 +44,7 @@ def discoverable() -> Discoverable[EntityInfo]: @pytest.fixture def discoverable_availability() -> Discoverable[EntityInfo]: """Return an instance of Discoverable configured with `manual_availability`""" - mqtt_settings = Settings.MQTT( - host="localhost", username="admin", password="password" - ) + mqtt_settings = Settings.MQTT(host="localhost") sensor_info = EntityInfo(name="test", component="binary_sensor") settings = Settings( mqtt=mqtt_settings, entity=sensor_info, manual_availability=True @@ -204,9 +200,7 @@ def test_device_with_unique_id(): def test_name_with_space(): - mqtt_settings = Settings.MQTT( - host="localhost", username="admin", password="password" - ) + mqtt_settings = Settings.MQTT(host="localhost") sensor_info = EntityInfo(name="Name with space", component="binary_sensor") settings = Settings(mqtt=mqtt_settings, entity=sensor_info) d = Discoverable[EntityInfo](settings) @@ -214,9 +208,7 @@ def test_name_with_space(): def test_custom_object_id(): - mqtt_settings = Settings.MQTT( - host="localhost", username="admin", password="password" - ) + mqtt_settings = Settings.MQTT(host="localhost") sensor_info = EntityInfo( name="Test name", component="binary_sensor", object_id="custom object id" ) @@ -301,9 +293,7 @@ def test_disconnect_client(mocker: MockerFixture): mocked_client = mocker.patch("paho.mqtt.client.Client") mock_instance = mocked_client.return_value mock_instance.connect.return_value = MQTT_ERR_SUCCESS - mqtt_settings = Settings.MQTT( - host="localhost", username="admin", password="password" - ) + mqtt_settings = Settings.MQTT(host="localhost") sensor_info = EntityInfo(name="test", component="binary_sensor") settings = Settings(mqtt=mqtt_settings, entity=sensor_info) From 6b657d467246215bec21fc8d9f3519ee23721d1d Mon Sep 17 00:00:00 2001 From: ha-enthus1ast Date: Tue, 19 Dec 2023 11:34:17 +0000 Subject: [PATCH 2/3] Set gitleaks to only run on PR commits Signed-off-by: ha-enthus1ast --- .mega-linter.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.mega-linter.yml b/.mega-linter.yml index de3b14e..6ce2509 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -4,6 +4,8 @@ VALIDATE_ALL_CODEBASE: false +REPOSITORY_GITLEAKS_PR_COMMITS_SCAN: true # Only scan PR commits for gitleaks + SPELL_MISSPELL_DISABLE_ERRORS: true DISABLE_LINTERS: From 9135f977701b26b66076140d22e47d67d580c345 Mon Sep 17 00:00:00 2001 From: ha-enthus1ast Date: Tue, 19 Dec 2023 11:44:40 +0000 Subject: [PATCH 3/3] Removed invalid option Signed-off-by: ha-enthus1ast --- .mega-linter.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index 6ce2509..de3b14e 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -4,8 +4,6 @@ VALIDATE_ALL_CODEBASE: false -REPOSITORY_GITLEAKS_PR_COMMITS_SCAN: true # Only scan PR commits for gitleaks - SPELL_MISSPELL_DISABLE_ERRORS: true DISABLE_LINTERS: