hass-core/tests
Tsvi Mostovicz eac2388d49 Set default value for input_datetime (#21919)
* Set default value for input_datetime

If no initial value is set and no value is available to be restored, set the default value as specified in the docs to 1970-01-01 00:00.

* Use regular if statement

Ternary statements can be tricky if you try to keep the value the same if not something

* Add test for default values

Check that if no initial value is set, state returns 1970-01-01 at 00:00

* Fix tests - was passing wrong args to time/date

* Verify we get a timestamp attribute for input_datetime

This adds a check that when using the default timestamp of 1970-1-1 00:00:00, we
get a timestamp attribute. This is waht prompted this PR in the first place, as
when specifying an automation trying to access the timestamp attribute for a non-
initialized input_datetime HASS wouldn't start.

* Simplify the change for a default value

Based on @balloob comment. Simplifying the code

* Revert "Simplify the change for a default value"

This reverts commit c2d67f19a6.
2019-04-18 21:00:35 -07:00
..
auth Add trusted_users in trusted networks auth provider (#22478) 2019-03-27 21:53:11 -07:00
components Set default value for input_datetime (#21919) 2019-04-18 21:00:35 -07:00
fixtures Add more HomeKit device enumeration tests (#22194) 2019-03-30 11:21:11 +01:00
helpers Remove loader.get_component (#23111) 2019-04-14 22:31:01 -07:00
mock Add zwave.network_complete_some_dead event (#16894) 2018-09-28 19:14:57 +02:00
resources Revised package util tests 2016-01-30 14:08:32 -05:00
scripts Migrate check-config to use get_integration (#23026) 2019-04-12 10:14:16 -07:00
test_util Fix ingress bug with Firefox (#23121) 2019-04-15 15:27:13 -07:00
testing_config Load requirements and dependencies from manifests. Fallback to current REQUIREMENTS and DEPENDENCIES (#22717) 2019-04-11 01:26:36 -07:00
util Ignore secrets.yaml when using include_dir_named (#22929) 2019-04-13 21:24:06 -07:00
__init__.py async HTTP component (#3914) 2016-10-23 23:48:01 -07:00
common.py Fix empty components (#23177) 2019-04-17 19:17:13 -07:00
conftest.py Deprecate http.api_password (#21884) 2019-03-10 19:55:36 -07:00
test_bootstrap.py Add support for after_dependencies (#23148) 2019-04-16 13:40:21 -07:00
test_config.py Fix check config script (#23151) 2019-04-16 17:14:25 -07:00
test_config_entries.py Further integration load cleanups (#23104) 2019-04-14 19:07:05 -07:00
test_core.py Re-thrown exception occurred in the blocking service call (#21573) 2019-03-01 23:09:31 -08:00
test_data_entry_flow.py Allow finish_flow callback to change data entry result type (#16100) 2018-08-21 10:48:24 -07:00
test_loader.py Load integrations only once (#23132) 2019-04-15 20:38:24 -07:00
test_main.py Hello Python 3.5 (#12610) 2018-02-22 23:22:27 -08:00
test_requirements.py Further integration load cleanups (#23104) 2019-04-14 19:07:05 -07:00
test_setup.py Remove loader.get_component (#23111) 2019-04-14 22:31:01 -07:00