catlink icon indicating copy to clipboard operation
catlink copied to clipboard

Added initial tests

Open milosljubenovic opened this issue 1 year ago • 4 comments

milosljubenovic avatar Sep 03 '24 14:09 milosljubenovic

Coverage Report

============================= test session starts ==============================
platform linux -- Python 3.12.5, pytest-8.3.1, pluggy-1.5.0
rootdir: /home/runner/work/catlink/catlink
plugins: sugar-1.0.0, requests-mock-1.12.1, unordered-0.6.1, github-actions-annotate-failures-0.2.0, cov-5.0.0, syrupy-4.6.1, xdist-3.6.1, socket-0.7.0, aiohttp-1.0.5, picked-0.5.0, timeout-2.3.1, asyncio-0.23.8, homeassistant-custom-component-0.13.160, anyio-4.4.0, respx-0.21.1, pytest_freezer-0.4.8
asyncio: mode=Mode.AUTO
collected 1 item

tests/test_init.py .                                                     [100%]

---------- coverage: platform linux, python 3.12.5-final-0 -----------
Name                                                       Stmts   Miss  Cover
------------------------------------------------------------------------------
custom_components/catlink/__init__.py                         34     11    68%
custom_components/catlink/binary_sensor.py                    10      0   100%
custom_components/catlink/button.py                           16      7    56%
custom_components/catlink/const.py                            24      0   100%
custom_components/catlink/entitites/__init__.py                3      0   100%
custom_components/catlink/entitites/catlink.py                46     33    28%
custom_components/catlink/entitites/catlink_binary.py         15      7    53%
custom_components/catlink/helpers.py                          19      5    74%
custom_components/catlink/models/__init__.py                   0      0   100%
custom_components/catlink/models/additional_cfg.py             6      0   100%
custom_components/catlink/modules/__init__.py                  7      0   100%
custom_components/catlink/modules/account.py                 125     88    30%
custom_components/catlink/modules/device.py                  150    104    31%
custom_components/catlink/modules/devices_coordinator.py      70     52    26%
custom_components/catlink/modules/feeder_device.py            98     63    36%
custom_components/catlink/modules/litterbox.py               229    172    25%
custom_components/catlink/modules/scooper_device.py          141     91    35%
custom_components/catlink/select.py                           32     17    47%
custom_components/catlink/sensor.py                           15      4    73%
custom_components/catlink/switch.py                           28     16    43%
------------------------------------------------------------------------------
TOTAL                                                       1068    670    37%


============================== 1 passed in 0.31s ===============================

github-actions[bot] avatar Sep 04 '24 10:09 github-actions[bot]

Coverage Report

============================= test session starts ==============================
platform linux -- Python 3.12.5, pytest-8.3.1, pluggy-1.5.0
rootdir: /home/runner/work/catlink/catlink
plugins: unordered-0.6.1, sugar-1.0.0, picked-0.5.0, pytest_freezer-0.4.8, asyncio-0.23.8, timeout-2.3.1, anyio-4.4.0, socket-0.7.0, syrupy-4.6.1, respx-0.21.1, github-actions-annotate-failures-0.2.0, requests-mock-1.12.1, cov-5.0.0, homeassistant-custom-component-0.13.160, aiohttp-1.0.5, xdist-3.6.1
asyncio: mode=Mode.AUTO
collected 1 item

tests/test_init.py .                                                     [100%]

---------- coverage: platform linux, python 3.12.5-final-0 -----------
Name                                                       Stmts   Miss  Cover
------------------------------------------------------------------------------
custom_components/catlink/__init__.py                         34     11    68%
custom_components/catlink/binary_sensor.py                    10      0   100%
custom_components/catlink/button.py                           16      7    56%
custom_components/catlink/const.py                            24      0   100%
custom_components/catlink/entitites/__init__.py                3      0   100%
custom_components/catlink/entitites/catlink.py                46     33    28%
custom_components/catlink/entitites/catlink_binary.py         15      7    53%
custom_components/catlink/helpers.py                          19      5    74%
custom_components/catlink/models/__init__.py                   0      0   100%
custom_components/catlink/models/additional_cfg.py             6      0   100%
custom_components/catlink/modules/__init__.py                  7      0   100%
custom_components/catlink/modules/account.py                 125     88    30%
custom_components/catlink/modules/device.py                  150    104    31%
custom_components/catlink/modules/devices_coordinator.py      70     52    26%
custom_components/catlink/modules/feeder_device.py            98     63    36%
custom_components/catlink/modules/litterbox.py               229    172    25%
custom_components/catlink/modules/scooper_device.py          141     91    35%
custom_components/catlink/select.py                           32     17    47%
custom_components/catlink/sensor.py                           15      4    73%
custom_components/catlink/switch.py                           28     16    43%
------------------------------------------------------------------------------
TOTAL                                                       1068    670    37%


============================== 1 passed in 0.34s ===============================

github-actions[bot] avatar Sep 04 '24 11:09 github-actions[bot]

Coverage Report

============================= test session starts ==============================
platform linux -- Python 3.12.5, pytest-8.3.1, pluggy-1.5.0
rootdir: /home/runner/work/catlink/catlink
plugins: sugar-1.0.0, requests-mock-1.12.1, unordered-0.6.1, github-actions-annotate-failures-0.2.0, cov-5.0.0, syrupy-4.6.1, xdist-3.6.1, socket-0.7.0, aiohttp-1.0.5, picked-0.5.0, timeout-2.3.1, asyncio-0.23.8, homeassistant-custom-component-0.13.160, anyio-4.4.0, respx-0.21.1, pytest_freezer-0.4.8
asyncio: mode=Mode.AUTO
collected 1 item

tests/test_init.py .                                                     [100%]

---------- coverage: platform linux, python 3.12.5-final-0 -----------
Name                                                       Stmts   Miss  Cover
------------------------------------------------------------------------------
custom_components/catlink/__init__.py                         35     11    69%
custom_components/catlink/binary_sensor.py                    10      0   100%
custom_components/catlink/button.py                           16      7    56%
custom_components/catlink/const.py                            24      0   100%
custom_components/catlink/entitites/__init__.py                3      0   100%
custom_components/catlink/entitites/catlink.py                46     33    28%
custom_components/catlink/entitites/catlink_binary.py         15      7    53%
custom_components/catlink/helpers.py                          19      5    74%
custom_components/catlink/models/__init__.py                   0      0   100%
custom_components/catlink/models/additional_cfg.py             6      0   100%
custom_components/catlink/modules/__init__.py                  7      0   100%
custom_components/catlink/modules/account.py                 125     88    30%
custom_components/catlink/modules/device.py                  150    104    31%
custom_components/catlink/modules/devices_coordinator.py      70     52    26%
custom_components/catlink/modules/feeder_device.py            98     63    36%
custom_components/catlink/modules/litterbox.py               229    172    25%
custom_components/catlink/modules/scooper_device.py          141     91    35%
custom_components/catlink/select.py                           32     19    41%
custom_components/catlink/sensor.py                           15      4    73%
custom_components/catlink/switch.py                           28     16    43%
------------------------------------------------------------------------------
TOTAL                                                       1069    672    37%


============================== 1 passed in 0.36s ===============================

github-actions[bot] avatar Sep 04 '24 19:09 github-actions[bot]

Coverage Report

============================= test session starts ==============================
platform linux -- Python 3.12.5, pytest-8.3.1, pluggy-1.5.0
rootdir: /home/runner/work/catlink/catlink
plugins: sugar-1.0.0, requests-mock-1.12.1, unordered-0.6.1, github-actions-annotate-failures-0.2.0, cov-5.0.0, syrupy-4.6.1, xdist-3.6.1, socket-0.7.0, aiohttp-1.0.5, picked-0.5.0, timeout-2.3.1, asyncio-0.23.8, homeassistant-custom-component-0.13.160, anyio-4.4.0, respx-0.21.1, pytest_freezer-0.4.8
asyncio: mode=Mode.AUTO
collected 3 items

tests/test_helpers.py ..                                                 [ 66%]
tests/test_init.py .                                                     [100%]

=============================== warnings summary ===============================
tests/test_helpers.py::TestHelper::test_async_setup_accounts
  /home/runner/work/catlink/catlink/tests/test_helpers.py:27: RuntimeWarning: coroutine 'Helper.async_setup_accounts' was never awaited
  Coroutine created at (most recent call last)
    File "/home/runner/work/catlink/catlink/venv/lib/python3.12/site-packages/pluggy/_hooks.py", line 513, in __call__
      return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
    File "/home/runner/work/catlink/catlink/venv/lib/python3.12/site-packages/pluggy/_manager.py", line 120, in _hookexec
      return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
    File "/home/runner/work/catlink/catlink/venv/lib/python3.12/site-packages/pluggy/_callers.py", line 103, in _multicall
      res = hook_impl.function(*args)
    File "/home/runner/work/catlink/catlink/venv/lib/python3.12/site-packages/_pytest/python.py", line 159, in pytest_pyfunc_call
      result = testfunction(**testargs)
    File "/home/runner/work/catlink/catlink/venv/lib/python3.12/site-packages/pytest_asyncio/plugin.py", line 906, in inner
      _loop.run_until_complete(task)
    File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
      self.run_forever()
    File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
      self._run_once()
    File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/asyncio/base_events.py", line 1978, in _run_once
      handle._run()
    File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/asyncio/events.py", line 88, in _run
      self._context.run(self._callback, *self._args)
    File "/home/runner/work/catlink/catlink/tests/test_helpers.py", line 27, in test_async_setup_accounts
      assert Helper.async_setup_accounts(hass, {})
    assert Helper.async_setup_accounts(hass, {})
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

---------- coverage: platform linux, python 3.12.5-final-0 -----------
Name                                                       Stmts   Miss  Cover
------------------------------------------------------------------------------
custom_components/catlink/__init__.py                         35     11    69%
custom_components/catlink/binary_sensor.py                     7      0   100%
custom_components/catlink/button.py                            7      0   100%
custom_components/catlink/const.py                            24      0   100%
custom_components/catlink/entitites/__init__.py                3      0   100%
custom_components/catlink/entitites/catlink.py                46     33    28%
custom_components/catlink/entitites/catlink_binary.py          3      0   100%
custom_components/catlink/helpers.py                          12      0   100%
custom_components/catlink/models/__init__.py                   0      0   100%
custom_components/catlink/models/additional_cfg.py             6      0   100%
custom_components/catlink/modules/__init__.py                  7      0   100%
custom_components/catlink/modules/account.py                 125     88    30%
custom_components/catlink/modules/device.py                  150    104    31%
custom_components/catlink/modules/devices_coordinator.py      70     52    26%
custom_components/catlink/modules/feeder_device.py            98     63    36%
custom_components/catlink/modules/litterbox.py               229    172    25%
custom_components/catlink/modules/scooper_device.py          141     91    35%
custom_components/catlink/select.py                           32     19    41%
custom_components/catlink/sensor.py                           10      0   100%
custom_components/catlink/switch.py                            7      0   100%
------------------------------------------------------------------------------
TOTAL                                                       1012    633    37%

========================= 3 passed, 1 warning in 0.59s =========================

github-actions[bot] avatar Sep 04 '24 19:09 github-actions[bot]