Skip to content

Commit

Permalink
Добавлено базовое тестирование на корректность импорта
Browse files Browse the repository at this point in the history
  • Loading branch information
dext0r committed Apr 23, 2024
1 parent 9c13fc7 commit 76e9d54
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,44 @@ jobs:

- uses: pre-commit/action@v3.0.1

tests:
name: Run tests (${{ matrix.ha-version }})
runs-on: ubuntu-latest
strategy:
matrix:
include:
- ha-version: '2023.9'
python-version: '3.11'
- ha-version: '2023.10'
python-version: '3.11'
- ha-version: '2023.11'
python-version: '3.11'
- ha-version: '2023.12'
python-version: '3.11'
- ha-version: '2024.1'
python-version: '3.11'
- ha-version: '2024.1'
python-version: '3.11'
- ha-version: '2024.2'
python-version: '3.12'
- ha-version: '2024.4'
python-version: '3.12'
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: tests/requirements_${{ matrix.ha-version }}.txt

- name: Install dependencies
run: |
pip install -r tests/requirements_${{ matrix.ha-version }}.txt
- name: Test with pytest
run: pytest

validate:
name: Validate for HACS
runs-on: ubuntu-latest
Expand Down
Empty file added tests/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions tests/requirements_2023.10.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest-homeassistant-custom-component==0.13.63
voluptuous-stubs==0.1.1
2 changes: 2 additions & 0 deletions tests/requirements_2023.11.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest-homeassistant-custom-component==0.13.70
voluptuous-stubs==0.1.1
2 changes: 2 additions & 0 deletions tests/requirements_2023.12.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest-homeassistant-custom-component==0.13.82
voluptuous-stubs==0.1.1
2 changes: 2 additions & 0 deletions tests/requirements_2023.9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest-homeassistant-custom-component==0.13.54
voluptuous-stubs==0.1.1
2 changes: 2 additions & 0 deletions tests/requirements_2024.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest-homeassistant-custom-component==0.13.88
voluptuous-stubs==0.1.1
2 changes: 2 additions & 0 deletions tests/requirements_2024.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest-homeassistant-custom-component==0.13.100
voluptuous-stubs==0.1.1
2 changes: 2 additions & 0 deletions tests/requirements_2024.4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest-homeassistant-custom-component==0.13.112
voluptuous-stubs==0.1.1
17 changes: 17 additions & 0 deletions tests/test_backward.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def test_backward() -> None:
from custom_components.yandex_station_intents import async_setup
from custom_components.yandex_station_intents.config_flow import YandexSmartHomeIntentsFlowHandler
from custom_components.yandex_station_intents.media_player import YandexStationIntentMediaPlayer
from custom_components.yandex_station_intents.yandex_intent import IntentManager
from custom_components.yandex_station_intents.yandex_quasar import YandexQuasar
from custom_components.yandex_station_intents.yandex_session import YandexSession

for o in [
async_setup,
YandexSmartHomeIntentsFlowHandler,
YandexStationIntentMediaPlayer,
IntentManager,
YandexQuasar,
YandexSession,
]:
assert o

0 comments on commit 76e9d54

Please sign in to comment.