Commit graph

23 commits

Author SHA1 Message Date
epenet
4142f0d15d
Add return type to tests without arguments ()
* Add return type to tests without arguments

* Black

* Cancel fixture amends
2023-02-07 14:20:06 +01:00
epenet
810367b757
Fix can not typo () 2023-02-03 11:37:16 +01:00
J. Nick Koston
9a27f1437d
Use default encoder when saving storage () 2022-07-17 14:25:19 +02:00
J. Nick Koston
8d0e54d776
Use the orjson equivalent default encoder when save_json is passed the default encoder () 2022-07-04 08:41:23 -05:00
J. Nick Koston
1866a1e925
Handle non-str keys when storing json data () 2022-06-24 09:59:01 -05:00
J. Nick Koston
fd9fdc6283
Fix error reporting with unserializable json () 2022-06-23 20:32:45 +02:00
Tobias Sauerwein
8b38fa58aa
Bump pytest to 7.0.0 () 2022-02-08 10:03:27 +01:00
Franck Nijhof
fa09cf663e
Update black to 22.1.0 () 2022-02-05 14:19:37 +01:00
Erik Montnemery
7c110eeef4
Remove Windows workarounds from tests/utils/test_json.py () 2022-01-17 19:34:46 +01:00
J. Nick Koston
96f7b0d910
Use atomicwrites for mission critical core files () 2021-11-15 11:19:31 +01:00
Paulus Schoutsen
7fe3c472e9
Improve bad JSON data reporting ()
* Improve bad data reporting

* Fix tests

Co-authored-by: Erik <erik@montnemery.com>
2021-03-15 10:41:25 +01:00
Franck Nijhof
65cf2fcb6f
Drop asynctest () 2021-01-01 22:31:56 +01:00
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 () 2020-08-27 13:56:20 +02:00
Paulus Schoutsen
2af984917e
Use asynctest-mock in most places ()
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Paulus Schoutsen
d93c09327a
Report unserializable data in websocket ()
* Report unserializable data in websocket

* Fix tests

* log types too
2020-04-13 23:46:41 -07:00
springstan
eae21be5b9
Improve string formatting v6 () 2020-04-07 23:14:28 +02:00
Paulus Schoutsen
a6b5d73f1c
Report which data causes JSON serialization error () 2020-02-17 10:49:42 -08:00
Bas Nijholt
f60125b5c9 Sort imports according to PEP8 for 'tests' () 2019-12-09 16:52:24 +01:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00
Erik Montnemery
407e0c58f9 Migrate tests to pytest ()
* Migrate tests to pytest

* Fixup

* Use loop fixture in test_check_config

* Lint
2019-04-30 09:20:38 -07:00
Adam Mills
5c3a4e3d10 Restore states through a JSON store instead of recorder ()
* Restore states through a JSON store

* Accept entity_id directly in restore state helper

* Keep states stored between runs for a limited time

* Remove warning
2018-11-28 13:16:43 +01:00
Paulus Schoutsen
08fe7c3ece
Pytest tests ()
* 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
Nicko van Someren
b0b3620b2b Added working support for private storage ()
* Fixed file corruption bugs in private storage code.

* Restoring fixed test case.

* Implemented test suite for utils/json.py

* Added new unit test cases for util/json.py

* Dixed formatting nags

* Fixed more nags from the Hound

* Added doc strings to some very short functions

* Fixing lint's complains about my choice of parts of speach. Sigh.

* Moved atomic save operations down into util/json.py so that all benefit.

Added extra clean-up code to ensure that temporary files are removed in
case of errors.
Updated emulated_hue unit tests to avoid errors.

* Apparently 'e' is not allows as a variable name for an exception...
2018-10-02 10:16:43 +02:00