core/tests
Nicko van Someren 4390fed168 Unpacking RESTful sensor JSON results into attributes. (#10753)
* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* sensor.envirophat: add missing requirement (#7451)

Adding requirements that is not explicitly pulled in by the library
that manages the Enviro pHAT.

* PyPI Openzwave (#7415)

* Remove default zwave config path

PYOZW now has much more comprehensive default handling for the config
path (in src-lib/libopenzwave/libopenzwave.pyx:getConfig()). It looks in
the same place we were looking, plus _many_ more. It will certainly do a
much better job of finding the config files than we will (and will be
updated as the library is changed, so we don't end up chasing it). The
getConfig() method has been there for a while, but was subsntially
improved recently.

This change simply leaves the config_path as None if it is not
specified, which will trigger the default handling in PYOZW.

* Install python-openzwave from PyPI

As of version 0.4, python-openzwave supports installation from PyPI,
which means we can use our 'normal' dependency management tooling to
install it. Yay.

This uses the default 'embed' build (which goes and downloads
statically sources to avoid having to compile anything locally). Check
out the python-openzwave readme for more details.

* Add python-openzwave deps to .travis.yml

Python OpenZwave require the libudev headers to build. This adds the
libudev-dev package to Travis runs via the 'apt' addon for Travis.

Thanks to @MartinHjelmare for this fix.

* Update docker build for PyPI openzwave

Now that PYOZW can be install from PyPI, the docker image build process
can be simplified to remove the explicit compilation of PYOZW.

* Add datadog component (#7158)

* Add datadog component

* Improve test_invalid_config datadog test

* Use assert_setup_component for test setup

* Fix object type for default KNX port

#7429 describes a TypeError that is raised if the port is omitted in the config for the KNX component (integer is required (got type str)). This commit changes the default port from a string to an integer. I expect this will resolve that issue...

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* Fixed breaks cause by manual upstream merge.

* Added one extra blank line to make PyLint happy.

* Switched json_attributes to be a list of keys rather than a boolean.

The value of json_attributes can now be either a comma sepaated list
of key names or a YAML list of key names. Only matching keys in a
retuned JSON dictionary will be mapped to sensor attributes.

Updated test cases to handle json_attributes being a list.

Also fixed two minor issues arrising from manual merge with 0.58 master.

* Added an explicit default value to the json_attributes config entry.

* Removed self.update() from __init__() body.

* Expended unit tests for error cases of json_attributes processing.

* Align quotes
2017-12-03 16:30:25 +01:00
..
components Unpacking RESTful sensor JSON results into attributes. (#10753) 2017-12-03 16:30:25 +01:00
fixtures Temporarily fix yahoo weather API issue and add unit test. (#10737) 2017-11-23 12:45:56 -08:00
helpers Add support for logarithm in templates (#10824) 2017-11-27 21:29:01 -08:00
mock Tests for zwave setup features (#7570) 2017-05-12 20:27:44 -07:00
resources Revised package util tests 2016-01-30 14:08:32 -05:00
scripts Remove http.development (#10267) 2017-11-01 13:07:16 +01:00
test_util Add cloud auth support (#9208) 2017-08-29 13:40:08 -07:00
testing_config Add Kira component to sensor and remote platforms (#7479) 2017-05-12 21:12:47 -07:00
util make RGB values consistent as int. fixes #10766 (#10782) 2017-11-27 11:31:35 +01:00
__init__.py async HTTP component (#3914) 2016-10-23 23:48:01 -07:00
common.py Fix a bunch of typos (#9545) 2017-09-23 17:15:46 +02:00
conftest.py Abort tests when instances leaked (#7623) 2017-05-18 00:19:40 +02:00
test_bootstrap.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_config.py Fix load of components without any config from packages (#9901) 2017-10-17 09:59:33 +02:00
test_core.py Clean up core (#10305) 2017-11-03 14:19:36 +01:00
test_loader.py RFC: Use bind_hass for helpers (#9745) 2017-10-08 08:17:54 -07:00
test_main.py Migrate core from threads to async awesomeness (#3248) 2016-09-12 19:16:14 -07:00
test_remote.py Remove deprecated remote classes (#7011) 2017-04-10 09:04:19 -07:00
test_setup.py Fix check for running inside venv (#8481) 2017-07-15 07:25:02 -07:00