4
0
Эх сурвалжийг харах

Add missing test coverage for device_config.py

Was missing coverage of the config property.
Now down to value-mirror (which needs a config using it, since the one it was created for was later changed to not use it) and handling of non-numeric scale.
Jason Rumney 4 жил өмнө
parent
commit
94b218650d

+ 0 - 1
requirements-dev.txt

@@ -1,5 +1,4 @@
 black
-homeassistant
 isort
 pytest-homeassistant-custom-component==0.4.5
 pytest

+ 5 - 4
tests/test_device_config.py

@@ -2,17 +2,13 @@
 from unittest import IsolatedAsyncioTestCase
 from unittest.mock import MagicMock
 
-from warnings import warn
-
 from custom_components.tuya_local.helpers.device_config import (
     available_configs,
     get_config,
-    possible_matches,
     TuyaDeviceConfig,
 )
 
 from .const import (
-    DEHUMIDIFIER_PAYLOAD,
     GPPH_HEATER_PAYLOAD,
     KOGAN_HEATER_PAYLOAD,
 )
@@ -77,3 +73,8 @@ class TestDeviceConfig(IsolatedAsyncioTestCase):
         cfg = get_config("kogan_switch")
         voltage = cfg.primary_entity.find_dps("voltage_v")
         self.assertIsNone(voltage.values(mock_device))
+
+    def test_config_returned(self):
+        """Test that config file is returned by config"""
+        cfg = get_config("kogan_switch")
+        self.assertEqual(cfg.config, "smartplugv1.yaml")