Commit Graph
59 Commits
Author SHA1 Message Date
Erik MontnemeryandGitHub 1e6c832c9a Add tests asserting trigger features (#168407) 2026-04-17 08:37:47 +02:00
Artur PragaczandGitHub f5fef37210 Remove bind_hass usage (#168369) 2026-04-16 15:38:59 +02:00
Erik MontnemeryandGitHub f84398eb9c Speed up trigger tests (#166522) 2026-03-26 00:51:14 +01:00
ea7558c0ad Improve naming in condition and trigger test helpers (#165847)
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-03-18 08:44:14 +01:00
Erik MontnemeryandGitHub 6992a3c72b Adjust name and docstring of some trigger tests (#165846) 2026-03-17 22:11:32 +01:00
Erik MontnemeryandGitHub fdfe87de4c Move condition/trigger test helpers to test.components.common (#165777) 2026-03-17 11:08:38 +01:00
Erik MontnemeryandGitHub 4769a769e0 Use return value from target_entities directly in all trigger tests (#165761) 2026-03-17 09:55:08 +01:00
9bbd9d8bcd Deduplicate trigger tests checking labs flag (#165760)
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
2026-03-17 08:19:10 +01:00
Erik MontnemeryandGitHub deefcbcbe4 Remove stub_blueprint_populate test fixture (#161288) 2026-01-20 15:46:06 +01:00
Erik MontnemeryandGitHub f01653633d Add shared enable_experimental_triggers_conditions test fixture (#160937) 2026-01-14 16:01:06 +00:00
Erik MontnemeryandGitHub a902f3bb00 Improve comments in trigger and condition test helpers (#160830) 2026-01-14 11:42:32 +00:00
c95416cb48 Add scene activated trigger (#159226)
Co-authored-by: Erik Montnemery <[email protected]>
2025-12-21 01:07:00 +00:00
epenetandGitHub f66b539027 Add missing hass type hint in component tests (s) (#124272) 2024-08-20 12:53:29 +02:00
epenetandGitHub c7e065c413 Move enable_custom_integrations fixture to decorator (#118844) 2024-06-05 09:20:08 +02:00
Jan-Philipp BeneckeandGitHub 9580adfde9 Use new setup_test_component_platform helper instead of test fixture for light platform (#114200) 2024-03-26 00:17:16 +01:00
Jan-Philipp BeneckeandGitHub edc19328c0 Remove deprecated hass.components from scene tests (#114014) 2024-03-22 17:48:53 +01:00
c615b52840 Refactor integration startup time to show wall clock time (#113707)
* Refactor setup time tracking to exclude time waiting on other operations

We now exclude the import time and th time waiting on
base platforms to setup from the setup times

* tweak

* tweak

* tweak

* tweak

* adjust

* fixes

* fixes

* preen

* preen

* tweak

* tweak

* adjust

* tweak

* reduce

* do not count integrtion platforms against their parent integration

* handle legacy tts platforms

* stt as well

* one more wait

* use the same pattern in all the legacy

* fix tts and stt legacy

* fix

* fix

* reduce

* preen

* entity comp does not wait for platforms

* scene blocks as well

* fix test

* test fixes

* coverage

* coverage

* coverage

* fix test

* Update tests/test_setup.py

Co-authored-by: Martin Hjelmare <[email protected]>

* Update tests/test_setup.py

Co-authored-by: Martin Hjelmare <[email protected]>

* Update homeassistant/setup.py

Co-authored-by: Martin Hjelmare <[email protected]>

* strip

* strip WAIT_PLATFORM_INTEGRATION

* strip WAIT_PLATFORM_INTEGRATION

* strip WAIT_PLATFORM_INTEGRATION

* strip WAIT_PLATFORM_INTEGRATION

* remove complexity

* Apply suggestions from code review

* no longer works that way

* fixes

* fixes

* fixes

---------

Co-authored-by: Martin Hjelmare <[email protected]>
2024-03-18 21:45:34 -04:00
J. Nick KostonandGitHub 052d7d1e19 Fix scene integration doing blocking I/O in the event loop to import platforms (#113391) 2024-03-14 14:56:57 -10:00
Marc MuellerandGitHub 32f3f46542 Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc MuellerandGitHub 7d6251ca08 Add empty line after module docstring [tests q-s] (#112711) 2024-03-08 14:47:22 +01:00
Erik MontnemeryandGitHub 3ca202a338 Fix scene tests (#110097) 2024-02-09 14:10:59 +01:00
epenetandGitHub 80ee196fd8 Add type hints to integration tests (part 19) (#88178) 2023-02-15 18:07:40 +01:00
epenetandGitHub ba85fdcd61 Add type hints to integration tests (q-s) (#87706) 2023-02-08 08:12:54 -08:00
Franck NijhofandGitHub ef800335fb Enable Ruff PT022 (#86792)
* Enable Ruff PT022

* Adjust found cases
2023-01-27 13:57:06 +01:00
J. Nick KostonandGitHub c9ac0b49f6 Prevent scene from restoring unavailable states (#67836) 2022-03-07 20:43:19 -08:00
Franck NijhofandGitHub 3f7275a9c7 Give scenes last activated state (#62673) 2022-01-07 19:02:32 +01:00
Erik MontnemeryandGitHub 154c849eac Filter unsupported parameters from light service calls (#51084)
* Filter unsupported parameters from light service calls

* Silence pylint

* Fix deconz tests

* Fix mqtt tests

* Fix scene tests

* Fix trådfri emulated CT

* Fix mqtt tests
2021-05-26 08:02:59 +02:00
Joakim SørensenandGitHub 2f10f59717 Block custom integrations with missing or invalid version (#49916) 2021-05-17 15:48:41 +02:00
Franck NijhofandGitHub 5a2b5fe7c5 Yoda assertion style removed is (#48142) 2021-03-20 13:55:10 +01:00
Ariana HlavatyandGitHub e28e453c08 Rewrite scene unittest tests to pytest style test function (#41172) 2020-10-15 23:35:30 +02:00
Paulus SchoutsenandGitHub c33edbe5bb Use TestCase.addCleanup (#36560) 2020-06-08 12:26:40 -07:00
276f3afb00 Do async_setup_platform in background (#36244)
Co-authored-by: J. Nick Koston <[email protected]>
2020-05-31 22:18:30 -07:00
Franck NijhofandGitHub bc5a2da7b7 Add transition support to scenes, cleanup blocking parameter (#34434) 2020-04-20 18:07:50 -07:00
Franck NijhofandGitHub 906385172a String formatting improvements for tests (#33663) 2020-04-05 00:26:08 +02:00
Paulus SchoutsenandGitHub 1f0f62de7f Add unique IDs to automation/scenes (#31150)
* Add unique IDs to automation and scenes

* Fix typo
2020-01-26 23:01:35 -08:00
Bas NijholtandFranck Nijhof 76debf4c88 Sort imports according to PEP8 for scene (#29750) 2019-12-09 13:12:43 +01:00
Paulus SchoutsenandGitHub 02d9ed5e36 Do not select all entities when omitting entity ID in service call (#29178)
* Do not select all entities when omitting entity ID

* Address comments Matthew

* Require either area_id or entity_id

* Fix tests

* Fix test
2019-12-02 16:23:12 -08:00
Erik MontnemeryandGitHub 6a60ebdb30 Rename MockToggleDevice to MockToggleEntity (#26644)
* Rename MockToggleDevice to MockToggleEntity

* Fix tests
2019-09-15 09:50:17 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
BackSlasherandPaulus Schoutsen 50d282ff37 Pyyaml5.1 (#24529)
* Migrated to PyYAML 5.1

* More intelligent fixing of yaml safe_load

Based on https://circleci.com/gh/home-assistant/home-assistant/34831?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link
2019-06-14 15:30:47 -07:00
Ties de KockandPaulus Schoutsen 4004867eda Split up yaml loaders into multiple files (#23774)
* Start moving parts of yaml utils to own module

Move parts of yaml loader out of the single large file and start
to create the structure of the yaml loaders in Ansible [0].

[0]: https://github.com/ansible/ansible/tree/devel/lib/ansible/parsing/yaml

* Finish yaml migration, update tests and mocks

  * Move code around to finish the migration
  * Update the mocks so that `open` is patched in
    `homeassistant.util.yaml.loader` instead of
    `homeassistant.util.yaml`.
  * Updated mypy ignores
  * Updated external API of `homeasistant.util.yaml`, see below:

Checked what part of the api of `homeassistant.util.yaml` was actually
called from outside the tests and added an `__ALL__` that contains only
these elements.

Updated the tests so that references to internal parts of the API (e.g.
the yaml module imported into `homeassistant.util.yaml.loader`) are
referenced directly from `homeassistant.util.yaml.loader`.

In `tests/test_yaml.py` the import `yaml` refers to
`homeassistant.util.yaml` and `yaml_loader` refers to `~.loader`.

Future work that remains for the next iteration is to create a custom
SafeConstructor and refers to that instead of monkey patching `yaml` with
custom loaders.

* Update mocks in yaml dumper, check_config
2019-05-09 09:07:56 -07:00
Paulus SchoutsenandJason Hu b0d893afc9 Remove loader.get_component (#23111)
* Remove get_component

* Lint
2019-04-14 22:31:01 -07:00
Rohan KapoorandJason Hu 6ba9ccf052 Load requirements and dependencies from manifests. Fallback to current REQUIREMENTS and DEPENDENCIES (#22717)
* Load dependencies from manifests. Fallback to current DEPENDENCIES

* Fix typing

* Ignore typing correctly

* Split out dependency processing to a new method

* Fix tests

* Only pull from manifest if dependencies is non empty

* Inline temporary function

* Fix light tests [skip ci]

* Fix tests/common

* Fix some mqtt tests [skip ci]

* Fix tests and component manifests which have only one platform

* Fix rflink tests

* Fix more tests and manifests

* Readability over shorthand format

* Fix demo/notify tests

* Load dependencies from manifests. Fallback to current DEPENDENCIES

* Load requirements from manifests. Fallback to current REQUIREMENTS

* Fix typing

* Ignore typing correctly

* Split out dependency processing to a new method

* Only pull from manifest if dependencies is non empty

* Inline temporary function

* Fix tests and component manifests which have only one platform

* Fix rflink tests

* Readability over shorthand format

* Clean up requirements

* Use integration to resolve deps/reqs

* Lint

* Lint

* revert a change

* Revert a test change

* Fix types

* Fix types

* Add back cache for load component

* Fix test_component_not_found

* Move light.test and device_tracker.test into test package instead with manifest to fix tests

* Fix broken device_tracker tests

* Add docstrings to __init__

* Fix all of the light tests that I broke earlier

* Embed the test.switch platform to fix other tests

* Embed and fix the test.imagimage_processing platform

* Fix tests for nx584

* Add dependencies from platform file's DEPENDENCIES

* Try to setup component when entity_platform is setting up

Fix tests in helpers folder

* Rewrite test_setup

* Simplify

* Lint

* Disable demo component if running in test

Temp workaround to unblock CI tests

* Skip demo tests

* Fix config entry test

* Fix repeat test

* Clarify doc

* One extra guard

* Fix import

* Lint

* Workaround google tts
2019-04-11 01:26:36 -07:00
Penny WoodandPaulus Schoutsen f195ecca4b Consolidate all platforms that have tests (#22109)
* Moved climate components with tests into platform dirs.

* Updated tests from climate component.

* Moved binary_sensor components with tests into platform dirs.

* Updated tests from binary_sensor component.

* Moved calendar components with tests into platform dirs.

* Updated tests from calendar component.

* Moved camera components with tests into platform dirs.

* Updated tests from camera component.

* Moved cover components with tests into platform dirs.

* Updated tests from cover component.

* Moved device_tracker components with tests into platform dirs.

* Updated tests from device_tracker component.

* Moved fan components with tests into platform dirs.

* Updated tests from fan component.

* Moved geo_location components with tests into platform dirs.

* Updated tests from geo_location component.

* Moved image_processing components with tests into platform dirs.

* Updated tests from image_processing component.

* Moved light components with tests into platform dirs.

* Updated tests from light component.

* Moved lock components with tests into platform dirs.

* Moved media_player components with tests into platform dirs.

* Updated tests from media_player component.

* Moved scene components with tests into platform dirs.

* Moved sensor components with tests into platform dirs.

* Updated tests from sensor component.

* Moved switch components with tests into platform dirs.

* Updated tests from sensor component.

* Moved vacuum components with tests into platform dirs.

* Updated tests from vacuum component.

* Moved weather components with tests into platform dirs.

* Fixed __init__.py files

* Fixes for stuff moved as part of this branch.

* Fix stuff needed to merge with balloob's branch.

* Formatting issues.

* Missing __init__.py files.

* Fix-ups

* Fixup

* Regenerated requirements.

* Linting errors fixed.

* Fixed more broken tests.

* Missing init files.

* Fix broken tests.

* More broken tests

* There seems to be a thread race condition.
I suspect the logger stuff is running in another thread, which means waiting until the aio loop is done is missing the log messages.
Used sleep instead because that allows the logger thread to run. I think the api_streams sensor might not be thread safe.

* Disabled tests, will remove sensor in #22147

* Updated coverage and codeowners.
2019-03-18 23:07:39 -07:00
Robert SvenssonandGitHub a3f0d55737 Change deCONZ to embedded platforms (#20113)
Move all platforms into components/deconz
2019-01-15 19:29:56 +01:00
Robert SvenssonandGitHub a9140dc8f5 deCONZ - retry if setup fails (#17772)
* Make component retry if setup fails
* Improve overall test coverage
2018-10-31 22:38:04 +01:00
Paulus SchoutsenandGitHub 08fe7c3ece Pytest tests (#17750)
* Convert core tests

* Convert component tests to use pytest assert

* Lint 🤷‍♂️

* Fix test

* Fix 3 typos in docs
2018-10-24 12:10:05 +02:00
cdce8pandPaulus Schoutsen 70b901017f Remove service helper (5) (#16917)
* Update switch

* Update script

* Update light

* Fix tests

* Fix config/script hook

* Async_create_task

* Fix flux switch
2018-09-27 23:13:11 +02:00
cdce8pandPaulus Schoutsen dd45e99302 Remove service helper (4) (#16892)
* Update media_player

* Update lock

* Update notify

* Update remote

* Update scene

* Update vacuum

* Remove timer helpers

* Removed unused legacy helpers
2018-09-26 18:02:05 +02:00
Paulus SchoutsenandPascal Vizeli 201fd4afee Add config entries to connection class (#16618) 2018-09-17 10:12:46 +02:00