1
mirror of https://github.com/home-assistant/core synced 2024-10-01 05:30:36 +02:00
Commit Graph

55 Commits

Author SHA1 Message Date
J. Nick Koston
eb98ac9415
Allow IntegrationNotFound when checking config in safe mode (#56283)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-09-17 22:25:50 -07:00
Paulus Schoutsen
7111fc47c4
Better handle invalid trigger config (#55637) 2021-09-03 10:15:57 -07:00
tkdrob
a5a45f29e2
Cleanup unused loggers (#46510) 2021-02-14 13:46:58 +01:00
Franck Nijhof
65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Stefan Agner
c2f5831181
Support dual stack IP support (IPv4 and IPv6) (#38046)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-08-04 15:34:23 +02:00
Joakim Plate
bcd604eec2
Detect lingering threads after tests (#37270)
* Detect lingering threads after tests

* Make sure cast is setup before checking state

* Make sure we ask executors of old hass to shutdown

We are not waiting here, just hoping for the best

* Make sure all instances of hass and executors is stopped.

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Also apply hass stopping to scripts

* Adjust to changes how we set up executor

* Add new CoreState.stopped

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-07-09 16:15:14 +02:00
Paulus Schoutsen
2af984917e
Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Paulus Schoutsen
5fdc60e067
Add Safe Mode (#30723)
* Store last working HTTP settings

* Add safe mode

* Fix tests

* Add cloud to safe mode

* Update logging text

* Fix camera tests leaving files behind

* Make emulated_hue tests not leave files behind

* Make logbook tests not leave files behind

* Make tts tests not leave files behind

* Make image_processing tests not leave files behind

* Make manual_mqtt tests not leave files behind
2020-01-14 13:03:02 -08:00
Ville Skyttä
e6388e186c
Remove unnecessary string literal concatenations (#30360) 2020-01-02 21:17:10 +02:00
Bas Nijholt
f60125b5c9 Sort imports according to PEP8 for 'tests' (#29791) 2019-12-09 16:52:24 +01:00
Ville Skyttä
d88ca0f5cb Lint exclusions (#28655)
* Remove malformed pylint disable markers

* Remove some unused imports

* Remove some unneeded lint exclusions

* Remove more unneeded lint exclusions

* Add specific codes to all noqa's
2019-11-16 10:22:07 +01:00
Paulus Schoutsen
3231e22ddf
Remove direct authentication via trusted networks or API password (#27656)
* Remove direct authentication via trusted networks and API password

* Fix tests
2019-10-14 14:56:45 -07:00
Erik Montnemery
e57e7e8449
Improve validation of device trigger config (#26910)
* Improve validation of device trigger config

* Remove action and condition checks

* Move config validation to own file

* Fix tests

* Fixes

* Fixes

* Small tweak
2019-09-27 17:48:48 +02:00
Joakim Plate
d1b9ebc7b2 Integration requirement check refactor (#25626)
* Factor out code getting requirements for integration

* Have process requirements raise an exception

* One more lint fix

* Blackify

* Catch new exception

* Let RequirementsNotFound be a HomeAssistantError

* Correct another test

* Split catching of exceptions and avoid complete log
2019-08-07 15:35:50 -07:00
Paulus Schoutsen
57f84cbbaa Update HTTP defaults (#25702)
* Update HTTP defaults

* Fix tests
2019-08-05 08:24:54 +02:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00
Johann Kellerman
2e26f0bd2b Add check_config helper (#24557)
* check_config

* no ignore

* tests

* try tests again
2019-07-10 11:56:50 -07:00
Erik Montnemery
407e0c58f9 Migrate tests to pytest (#23544)
* Migrate tests to pytest

* Fixup

* Use loop fixture in test_check_config

* Lint
2019-04-30 09:20:38 -07:00
Paulus Schoutsen
f269135ae9
Migrate check-config to use get_integration (#23026)
* Migrate check-config to use get_integration

* ImportError
2019-04-12 10:14:16 -07:00
emontnemery
16e3ff2fec Mqtt light refactor (#18227)
* Rename mqtt light files

* Refactor mqtt light

* Remove outdated testcase

* Add backwards compatibility for MQTT discovered MQTT lights.
Refactor according to review comments.
2018-11-27 14:00:05 +01:00
Martin Hjelmare
07840f5397 Fix check config packages key error (#15840)
* Fix packages deletion in check_config script

* The config key for packages is not present if core config validation
  failed. We need to do a safe dict deletion using dict.pop.

* Add check_config test for bad core config
2018-08-17 05:28:00 +02:00
Paulus Schoutsen
6540d2e073
Switch to intermediate Mozilla cert profile (#15957)
* Allow choosing intermediate SSL profile

* Fix tests
2018-08-14 08:20:17 +02:00
Jason Hu
6f2000f5e2 Make sure use_x_forward_for and trusted_proxies must config together (#15804)
* Make sure use_x_forward_for and trusted_proxies must config together

* Fix unit test
2018-08-03 13:52:34 +02:00
Paulus Schoutsen
2fcacbff23
Allow auth providers to influence is_active (#15557)
* Allow auth providers to influence is_active

* Fix auth script test
2018-07-19 22:10:36 +02:00
Paulus Schoutsen
538236de8f Fix formatting pylint comments in test (#15450) 2018-07-13 23:02:23 +02:00
Paulus Schoutsen
70fe463ef0
User management (#15420)
* User management

* Lint

* Fix dict

* Reuse data instance

* OrderedDict all the way
2018-07-13 15:31:20 +02:00
Paulus Schoutsen
b6ca03ce47
Reorg auth (#15443) 2018-07-13 11:43:08 +02:00
Colin O'Dell
fd38caa287 X-Forwarded-For improvements and bug fixes (#15204)
* Use new trusted_proxies setting for X-Forwarded-For whitelist

* Only use the last IP in the header

Per Wikipedia (https://en.wikipedia.org/wiki/X-Forwarded-For#Format):

 > The last IP address is always the IP address that connects to the last proxy,
 > which means it is the most reliable source of information.

* Add two additional tests

* Ignore nonsense header values instead of failing
2018-06-29 16:27:06 -04:00
Paulus Schoutsen
26590e244c
Migrate home assistant auth provider to use storage helper (#15200) 2018-06-29 00:02:45 -04:00
Paulus Schoutsen
ea01b127c2
Add local auth provider (#14365)
* Add local auth provider

* Lint

* Docstring
2018-05-10 14:09:22 -04:00
Paulus Schoutsen
83d300fd11 Custom component loading cleanup (#14211)
* Clean up custom component loading

* Fix some tests

* Fix some stuff

* Make imports work again

* Fix tests

* Remove debug print

* Lint
2018-05-01 20:57:30 +02:00
Otto Winter
27c1806897 Python 3.5 adjustments (#13173) 2018-03-15 13:10:54 +02:00
Johann Kellerman
6734c966b3 check_config script evolution (#12792)
* Initial async_check_ha_config_file

* check_ha_config_file

* Various fixes

* feedback - return the config

* move_to_check_config
2018-03-08 19:34:24 -08:00
Paulus Schoutsen
3fd61d8f45 Update voluputous (#12463)
* Update voluputous

* Fix http config

* Fix optional with default=None

* Optional, default=none

* Fix defaults in voluptuous schemas

* Fix tests

* Fix update error

* Lint
2018-02-17 10:29:14 +01:00
Paulus Schoutsen
8b9eab196c
Attempt fixing flakiness of check config test (#12283)
* Attempt fixing check_config script test flakiness

* Fix logging

* remove cleanup as Python will exit

* Make sure we don't enqueue magicmocks

* Lint

* Reinstate cleanup as it broke secret tests
2018-02-11 09:00:02 -08:00
Johann Kellerman
65c6f72c9d check_config check bootstrap errors (#12291) 2018-02-10 23:40:48 -08:00
Paulus Schoutsen
4dc9ac820f Remove http.development (#10267)
* Remove http.development

* Remove development

* Remove development from tests

* Remove constant
2017-11-01 13:07:16 +01:00
Pascal Vizeli
814834512a Group service / dynamic handling (#7971)
* Add Service to group

* Finish service

* Add service functions

* fix lint

* Address paulus comments

* fix lint & cleanup

* fix lint

* fix lint

* fix lint p3

* add test for check group

* add more tests

* fix lint

* Update service.yaml

* Fix order for tests

* Fix comment

* Fix test

* Fix tests

* Fix name in tests

* Fix view

* Fix default value

* Fix lint

* Fix key error

* add name

* migrate component entity

* fix tests

* fix import

* migrate device tracker

* fix lint

* fix bug

* fix logic

* fix lint

* fix tests

* fix generator

* fix group

* fix other tests.

* Not need to load group on first stage anymore.

* fix service

* add more group depency

* fix tests

* Revert "fix tests"

This reverts commit 35a922b3a8.

* Real fix

* fix test p2

* fix test p3

* fix test p4

* fix test p5

* fix test p6

* fix lint

* fix test p7

* Rename attribute

* fix group test

* fix bug

* fix flagy tests

* fix service.yaml

* fix lint
2017-06-16 00:52:28 +02:00
Paulus Schoutsen
6899c7b6f7 assertEquals is deprecated (#7777) 2017-05-25 22:21:22 -07:00
Dennis de Greef
5183cb5903 Be able to select mqtt:tls_version for Python < 3.6 (#6442)
* Be able to select tls_version

* This test should always assert this value, not only in 3.6

* Disable linting on future property (py36)

* Only allow TLS 1.0, 1.1 and 1.2

* Fix line length issue

* Fix check config tests

* Allow auto as a TLS version
2017-03-12 22:02:59 -07:00
Paulus Schoutsen
84f30d9ef8 Bootstrap tweaks tests (#6326)
* Update strings/fix component not found message.

* Fix tests

* More tweak text
2017-02-28 23:42:31 -08:00
Johann Kellerman
ac49298c8d Log errors when loading yaml (#6257) 2017-03-01 06:56:23 +02:00
Fabian Affolter
c7fd28c10f MQTT discovery (#5724)
* Change implementation

* Re-write

* Remove unused consts

* Update discovery.py

* Add tests

* fix other tests

* Fix check_config script test

* Lint

* Lint
2017-02-07 09:13:24 -08:00
Johann Kellerman
3f2fdb97a0 check_config: Add support for packages (#5574) 2017-01-26 21:42:14 -08:00
Paulus Schoutsen
32ffd006fa Reorganize HTTP component (#4575)
* Move HTTP to own folder

* Break HTTP into middlewares

* Lint

* Split tests per middleware

* Clean up HTTP tests

* Make HomeAssistantViews more stateless

* Lint

* Make HTTP setup async
2016-11-25 13:04:06 -08:00
hexa-
e73634e6c7 http: reimplement X-Forwarded-For parsing (#4355)
This feature needs to be enabled through the `http.use_x_forwarded_for` option,
satisfying security concerns of spoofed remote addresses in untrusted network
environments.

The testsuite was enhanced to explicitly test the functionality of the
header.

Fixes #4265.

Signed-off-by: Martin Weinelt <hexa@darmstadt.ccc.de>
2016-11-12 16:14:39 -08:00
Pascal Vizeli
d5368f6f78 Async bootstrap / component init (#3991)
* Async bootstrap

* Adress comments

* Fix tests

* More fixes

* Tests fixes
2016-10-27 00:16:23 -07:00
Johann Kellerman
cb322f72db Add persistent notifications to bootstrap (#3738)
* Add persistent notifications to bootstrap

* Rebase, Fix test
2016-10-13 09:09:07 -07:00
Johann Kellerman
7b40a641ec Continue on invalid platforms and new setup_component unit tests (#3736) 2016-10-08 11:27:35 -07:00
Fabian Affolter
f75b0a99d9 Use voluptuous for Hue (#3340)
* Migrate to voluptuous

* Change name used in test
2016-09-20 12:35:10 +02:00