You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clean, human-readable tests for your Appdaemon automations.
6
6
@@ -88,7 +88,7 @@ Let's test an Appdaemon automation we created, which, say, handles automatic lig
88
88
```
89
89
> ##### Note
90
90
>
91
-
> The following fixtures are **injected** by pytest using the **[`conftest.py`](https://github.com/FlorianKempenich/Appdaemon-Test-Framework/blob/new-features/doc/full_example/conftest.py) file** and the **initialisation fixture created at Step 1**:
91
+
> The following fixtures are **injected** by pytest using the **[`conftest.py`](https://github.com/HelloThisIsFlo/Appdaemon-Test-Framework/blob/new-features/doc/full_example/conftest.py) file** and the **initialisation fixture created at Step 1**:
92
92
>
93
93
> -`living_room`
94
94
> -`given_that`
@@ -337,7 +337,7 @@ class LivingRoom(hass.Hass):
337
337
338
338
**NOTE:** The above examples can be used with run_minutely.
339
339
340
-
_See related test file for more examples: [test_assert_callback_registration.py](https://github.com/FlorianKempenich/Appdaemon-Test-Framework/blob/master/test/test_assert_callback_registration.py)_
340
+
_See related test file for more examples: [test_assert_callback_registration.py](https://github.com/HelloThisIsFlo/Appdaemon-Test-Framework/blob/master/test/test_assert_callback_registration.py)_
@@ -468,7 +468,7 @@ This test framework abstracts away all that complexity, allowing for a smooth TD
468
468
**Couldn't we just use the MVP pattern with clear interfaces at the boundaries?**
469
469
_Yes we could... but would we?
470
470
Let's be pragmatic, with this kind of project we're developing for our home, and we're a team of one.
471
-
While being a huge proponent for [clean architecture](https://floriankempenich.com/post/11), I believe using such a complex architecture for such a simple project would only result in bringing more complexity than necessary._
471
+
While being a huge proponent for [clean architecture](https://professionalbeginner.com/post/11), I believe using such a complex architecture for such a simple project would only result in bringing more complexity than necessary._
472
472
473
473
### Enjoy the simplicity
474
474
@@ -492,7 +492,7 @@ After all tests have run, the `hass_mocks` test fixture will automatically unpat
492
492
**`hass_functions`** are injected in the helpers when creating their instances.
493
493
After all tests, **`unpatch_callback`**is used to un-patch all patched functions.
494
494
495
-
Setup and teardown are handled in the [`pytest_conftest.py`](https://github.com/FlorianKempenich/Appdaemon-Test-Framework/blob/master/appdaemontestframework/pytest_conftest.py) file.
495
+
Setup and teardown are handled in the [`pytest_conftest.py`](https://github.com/HelloThisIsFlo/Appdaemon-Test-Framework/blob/master/appdaemontestframework/pytest_conftest.py) file.
If you do no wish to use `pytest`, first maybe reconsider, `pytest`is awesome :)
647
647
If you're really set on using something else, worry not it's pretty straighforward too ;)
648
648
649
-
What the [`conftest.py`](https://github.com/FlorianKempenich/Appdaemon-Test-Framework/blob/new-features/doc/full_example/conftest.py) fileis doing is simply handling the setup & teardown, as well as providing the helpers as injectable fixtures.
650
-
It is pretty easy to replicate the same behavior with your test framework of choice. For instance, with`unittest` a base `TestCase` can replace pytest [`conftest.py`](https://github.com/FlorianKempenich/Appdaemon-Test-Framework/blob/new-features/doc/full_example/conftest.py). See the [Unittest Example](https://github.com/FlorianKempenich/Appdaemon-Test-Framework/blob/master/doc/unittest_example.py)
649
+
What the [`conftest.py`](https://github.com/HelloThisIsFlo/Appdaemon-Test-Framework/blob/new-features/doc/full_example/conftest.py) fileis doing is simply handling the setup & teardown, as well as providing the helpers as injectable fixtures.
650
+
It is pretty easy to replicate the same behavior with your test framework of choice. For instance, with`unittest` a base `TestCase` can replace pytest [`conftest.py`](https://github.com/HelloThisIsFlo/Appdaemon-Test-Framework/blob/new-features/doc/full_example/conftest.py). See the [Unittest Example](https://github.com/HelloThisIsFlo/Appdaemon-Test-Framework/blob/master/doc/unittest_example.py)
651
651
652
652
### Direct call to mocked functions
653
653
654
654
>/!\ WARNING — EXPERIMENTAL /!\
655
655
656
656
**Want a functionality not implemented by the helpers?**
657
657
You can inject `hass_mocks` directly in your tests and use `hass_mocks.hass_functions`, patched functions are `MagicMocks`.
658
-
The list of patched functions can be found in the [**`hass_mocks` module**](https://github.com/FlorianKempenich/Appdaemon-Test-Framework/blob/master/appdaemontestframework/hass_mocks.py#L20framework.py#L14).
658
+
The list of patched functions can be found in the [**`hass_mocks` module**](https://github.com/HelloThisIsFlo/Appdaemon-Test-Framework/blob/master/appdaemontestframework/hass_mocks.py#L20framework.py#L14).
659
659
660
660
---
661
661
@@ -706,5 +706,5 @@ If you prefer using pip:
706
706
707
707
## Author Information
708
708
709
-
Follow me on Twitter: [@ThisIsFlorianK](https://twitter.com/ThisIsFlorianK)
710
-
Find out more about my work: [Florian Kempenich — Personal Website](https://floriankempenich.com)
709
+
Follow me on Twitter: [@HelloThisIsFlo](https://twitter.com/HelloThisIsFlo)
710
+
Find out more about my work: [Flo Kempenich — Personal Website](https://professionalbeginner.com)
0 commit comments