Update test_panasonic_heatpump_integration.py

This commit is contained in:
ElVit 2025-12-08 09:49:49 +01:00 committed by GitHub
parent f9366fe43d
commit 0f2403f02c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 36 additions and 10 deletions

View File

@ -16,33 +16,58 @@ class TestPanasonicHeatpumpIntegration:
def test_yaml_esp8266(self):
"""Get the path to the ESP8266 test YAML file."""
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
return os.path.join(base_dir, 'tests', 'panasonic_heatpump', 'test_panasonic_heatpump_esp8266.yaml')
return os.path.join(
base_dir,
'tests',
'panasonic_heatpump',
'test_panasonic_heatpump_esp8266.yaml'
)
@pytest.fixture
def test_yaml_esp32(self):
"""Get the path to the ESP32 test YAML file."""
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
return os.path.join(base_dir, 'tests', 'panasonic_heatpump', 'test_panasonic_heatpump_full.yaml')
return os.path.join(
base_dir,
'tests',
'panasonic_heatpump',
'test_panasonic_heatpump_full.yaml'
)
@pytest.fixture
def test_yaml_esp32s2(self):
"""Get the path to the ESP32-S2 test YAML file."""
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
return os.path.join(base_dir, 'tests', 'panasonic_heatpump', 'test_panasonic_heatpump_esp32s2.yaml')
return os.path.join(
base_dir,
'tests',
'panasonic_heatpump',
'test_panasonic_heatpump_esp32s2.yaml',
)
@pytest.fixture
def test_yaml_esp32c3(self):
"""Get the path to the ESP32-C3 test YAML file."""
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
return os.path.join(base_dir, 'tests', 'panasonic_heatpump', 'test_panasonic_heatpump_esp32c3.yaml')
return os.path.join(
base_dir,
'tests',
'panasonic_heatpump',
'test_panasonic_heatpump_esp32c3.yaml',
)
@pytest.fixture
def test_yaml_cztaw1(self):
"""Get the path to the CZ-TAW1 client test YAML file."""
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
return os.path.join(base_dir, 'tests', 'panasonic_heatpump', 'test_panasonic_heatpump_cztaw1.yaml')
return os.path.join(
base_dir,
'tests',
'panasonic_heatpump',
'test_panasonic_heatpump_cztaw1.yaml',
)
def test_validate_esp8266_config(self, test_yaml_esp8266):
def test_validate_esp8266_config(self, test_yaml_esp8266: str):
"""Test that the ESP8266 configuration is valid."""
if not os.path.exists(test_yaml_esp8266):
pytest.skip(f"Test file not found: {test_yaml_esp8266}")
@ -60,7 +85,7 @@ class TestPanasonicHeatpumpIntegration:
except subprocess.TimeoutExpired:
pytest.fail("ESPHome config validation timed out")
def test_validate_esp32_config(self, test_yaml_esp32):
def test_validate_esp32_config(self, test_yaml_esp32: str):
"""Test that the ESP32 configuration is valid."""
if not os.path.exists(test_yaml_esp32):
pytest.skip(f"Test file not found: {test_yaml_esp32}")
@ -78,7 +103,7 @@ class TestPanasonicHeatpumpIntegration:
except subprocess.TimeoutExpired:
pytest.fail("ESPHome config validation timed out")
def test_validate_esp32s2_config(self, test_yaml_esp32s2):
def test_validate_esp32s2_config(self, test_yaml_esp32s2: str):
"""Test that the ESP32-S2 configuration is valid."""
if not os.path.exists(test_yaml_esp32s2):
pytest.skip(f"Test file not found: {test_yaml_esp32s2}")
@ -96,7 +121,7 @@ class TestPanasonicHeatpumpIntegration:
except subprocess.TimeoutExpired:
pytest.fail("ESPHome config validation timed out")
def test_validate_esp32c3_config(self, test_yaml_esp32c3):
def test_validate_esp32c3_config(self, test_yaml_esp32c3: str):
"""Test that the ESP32-C3 configuration is valid."""
if not os.path.exists(test_yaml_esp32c3):
pytest.skip(f"Test file not found: {test_yaml_esp32c3}")
@ -114,7 +139,7 @@ class TestPanasonicHeatpumpIntegration:
except subprocess.TimeoutExpired:
pytest.fail("ESPHome config validation timed out")
def test_validate_cztaw1_config(self, test_yaml_cztaw1):
def test_validate_cztaw1_config(self, test_yaml_cztaw1: str):
"""Test that the CZ-TAW1 client configuration with UART-proxy is valid."""
if not os.path.exists(test_yaml_cztaw1):
pytest.skip(f"Test file not found: {test_yaml_cztaw1}")
@ -132,5 +157,6 @@ class TestPanasonicHeatpumpIntegration:
except subprocess.TimeoutExpired:
pytest.fail("ESPHome config validation timed out")
if __name__ == '__main__':
pytest.main([__file__, '-v'])