python-tado 0.18.0__tar.gz → 0.18.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {python_tado-0.18.0/python_tado.egg-info → python_tado-0.18.1}/PKG-INFO +3 -1
  2. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/http.py +1 -0
  3. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/interface/interface.py +1 -1
  4. {python_tado-0.18.0 → python_tado-0.18.1}/pyproject.toml +2 -2
  5. {python_tado-0.18.0 → python_tado-0.18.1/python_tado.egg-info}/PKG-INFO +3 -1
  6. {python_tado-0.18.0 → python_tado-0.18.1}/python_tado.egg-info/SOURCES.txt +2 -1
  7. {python_tado-0.18.0 → python_tado-0.18.1}/python_tado.egg-info/requires.txt +2 -0
  8. {python_tado-0.18.0 → python_tado-0.18.1}/tests/test_my_zone.py +1 -1
  9. python_tado-0.18.1/tests/test_tado_interface.py +72 -0
  10. {python_tado-0.18.0 → python_tado-0.18.1}/AUTHORS +0 -0
  11. {python_tado-0.18.0 → python_tado-0.18.1}/LICENSE +0 -0
  12. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/__init__.py +0 -0
  13. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/__main__.py +0 -0
  14. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/const.py +0 -0
  15. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/exceptions.py +0 -0
  16. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/interface/__init__.py +0 -0
  17. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/interface/api/__init__.py +0 -0
  18. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/interface/api/hops_tado.py +0 -0
  19. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/interface/api/my_tado.py +0 -0
  20. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/logging.py +0 -0
  21. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/zone/__init__.py +0 -0
  22. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/zone/hops_zone.py +0 -0
  23. {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/zone/my_zone.py +0 -0
  24. {python_tado-0.18.0 → python_tado-0.18.1}/README.md +0 -0
  25. {python_tado-0.18.0 → python_tado-0.18.1}/python_tado.egg-info/dependency_links.txt +0 -0
  26. {python_tado-0.18.0 → python_tado-0.18.1}/python_tado.egg-info/entry_points.txt +0 -0
  27. {python_tado-0.18.0 → python_tado-0.18.1}/python_tado.egg-info/not-zip-safe +0 -0
  28. {python_tado-0.18.0 → python_tado-0.18.1}/python_tado.egg-info/top_level.txt +0 -0
  29. {python_tado-0.18.0 → python_tado-0.18.1}/setup.cfg +0 -0
  30. {python_tado-0.18.0 → python_tado-0.18.1}/tests/test_my_tado.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-tado
3
- Version: 0.18.0
3
+ Version: 0.18.1
4
4
  Summary: PyTado from chrism0dwk, modfied by w.malgadey, diplix, michaelarnauts, LenhartStephan, splifter, syssi, andersonshatch, Yippy, p0thi, Coffee2CodeNL, chiefdragon, FilBr, nikilase, albertomontesg, Moritz-Schmidt, palazzem
5
5
  Author-email: Chris Jewell <chrism0dwk@gmail.com>, "w.malgadey" <w.malgadey@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -699,7 +699,9 @@ Requires-Dist: black>=24.3; extra == "dev"
699
699
  Requires-Dist: pytype; extra == "dev"
700
700
  Requires-Dist: pylint; extra == "dev"
701
701
  Requires-Dist: types-requests; extra == "dev"
702
+ Requires-Dist: coverage; extra == "dev"
702
703
  Requires-Dist: pytest; extra == "dev"
704
+ Requires-Dist: pytest-cov; extra == "dev"
703
705
 
704
706
  PyTado -- Pythonize your central heating
705
707
  ========================================
@@ -199,6 +199,7 @@ class Http:
199
199
 
200
200
  return response.json()
201
201
 
202
+ @property
202
203
  def is_x_line(self):
203
204
  return self._x_api
204
205
 
@@ -36,4 +36,4 @@ class Tado:
36
36
 
37
37
  def __getattr__(self, name):
38
38
  """Delegiert den Aufruf von Methoden an die richtige API-Client-Implementierung."""
39
- return getattr(self.client, name)
39
+ return getattr(self._api, name)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "python-tado"
7
- version = "0.18.0"
7
+ version = "0.18.1"
8
8
  description = "PyTado from chrism0dwk, modfied by w.malgadey, diplix, michaelarnauts, LenhartStephan, splifter, syssi, andersonshatch, Yippy, p0thi, Coffee2CodeNL, chiefdragon, FilBr, nikilase, albertomontesg, Moritz-Schmidt, palazzem"
9
9
  authors = [
10
10
  { name = "Chris Jewell", email = "chrism0dwk@gmail.com" },
@@ -30,7 +30,7 @@ classifiers = [
30
30
  GitHub = "https://github.com/wmalgadey/PyTado"
31
31
 
32
32
  [project.optional-dependencies]
33
- dev = ["black>=24.3", "pytype", "pylint", "types-requests", "pytest"]
33
+ dev = ["black>=24.3", "pytype", "pylint", "types-requests", "coverage", "pytest", "pytest-cov"]
34
34
 
35
35
  [project.scripts]
36
36
  pytado = "pytado.__main__:main"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-tado
3
- Version: 0.18.0
3
+ Version: 0.18.1
4
4
  Summary: PyTado from chrism0dwk, modfied by w.malgadey, diplix, michaelarnauts, LenhartStephan, splifter, syssi, andersonshatch, Yippy, p0thi, Coffee2CodeNL, chiefdragon, FilBr, nikilase, albertomontesg, Moritz-Schmidt, palazzem
5
5
  Author-email: Chris Jewell <chrism0dwk@gmail.com>, "w.malgadey" <w.malgadey@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -699,7 +699,9 @@ Requires-Dist: black>=24.3; extra == "dev"
699
699
  Requires-Dist: pytype; extra == "dev"
700
700
  Requires-Dist: pylint; extra == "dev"
701
701
  Requires-Dist: types-requests; extra == "dev"
702
+ Requires-Dist: coverage; extra == "dev"
702
703
  Requires-Dist: pytest; extra == "dev"
704
+ Requires-Dist: pytest-cov; extra == "dev"
703
705
 
704
706
  PyTado -- Pythonize your central heating
705
707
  ========================================
@@ -24,4 +24,5 @@ python_tado.egg-info/not-zip-safe
24
24
  python_tado.egg-info/requires.txt
25
25
  python_tado.egg-info/top_level.txt
26
26
  tests/test_my_tado.py
27
- tests/test_my_zone.py
27
+ tests/test_my_zone.py
28
+ tests/test_tado_interface.py
@@ -5,4 +5,6 @@ black>=24.3
5
5
  pytype
6
6
  pylint
7
7
  types-requests
8
+ coverage
8
9
  pytest
10
+ pytest-cov
@@ -10,7 +10,7 @@ from PyTado.http import Http
10
10
  from PyTado.interface.api import Tado
11
11
 
12
12
 
13
- class TadoTestCase(unittest.TestCase):
13
+ class TadoZoneTestCase(unittest.TestCase):
14
14
  """Test cases for zone class"""
15
15
 
16
16
  def setUp(self) -> None:
@@ -0,0 +1,72 @@
1
+ import json
2
+ import unittest
3
+ from unittest import mock
4
+
5
+ from . import common
6
+
7
+ from PyTado.http import Http
8
+ from PyTado.interface import Tado
9
+ import PyTado.interface.api as API
10
+
11
+
12
+ class TestTadoInterface(unittest.TestCase):
13
+ """Test cases for main tado interface class"""
14
+
15
+ def test_interface_with_tado_api(self):
16
+ login_patch = mock.patch(
17
+ "PyTado.http.Http._login", return_value=(1, False, "foo")
18
+ )
19
+ login_mock = login_patch.start()
20
+ self.addCleanup(login_patch.stop)
21
+
22
+ with mock.patch("PyTado.interface.api.my_tado.Tado.get_me") as mock_it:
23
+ tado_interface = Tado("my@username.com", "mypassword")
24
+ tado_interface.get_me()
25
+
26
+ assert not tado_interface._http.is_x_line
27
+ mock_it.assert_called_once()
28
+
29
+ with mock.patch(
30
+ "PyTado.interface.api.hops_tado.TadoX.get_me"
31
+ ) as mock_it:
32
+ tado_interface = Tado("my@username.com", "mypassword")
33
+ tado_interface.get_me()
34
+
35
+ mock_it.assert_not_called()
36
+
37
+ assert login_mock.call_count == 2
38
+
39
+ def test_interface_with_tadox_api(self):
40
+ login_patch = mock.patch(
41
+ "PyTado.http.Http._login", return_value=(1, True, "foo")
42
+ )
43
+ login_mock = login_patch.start()
44
+ self.addCleanup(login_patch.stop)
45
+
46
+ with mock.patch(
47
+ "PyTado.interface.api.hops_tado.TadoX.get_me"
48
+ ) as mock_it:
49
+ tado_interface = Tado("my@username.com", "mypassword")
50
+ tado_interface.get_me()
51
+
52
+ mock_it.assert_called_once()
53
+ assert tado_interface._http.is_x_line
54
+
55
+ login_mock.assert_called_once()
56
+
57
+ def test_error_handling_on_api_calls(self):
58
+ login_patch = mock.patch(
59
+ "PyTado.http.Http._login", return_value=(1, False, "foo")
60
+ )
61
+ login_patch.start()
62
+ self.addCleanup(login_patch.stop)
63
+
64
+ with mock.patch("PyTado.interface.api.my_tado.Tado.get_me") as mock_it:
65
+ mock_it.side_effect = Exception("API Error")
66
+
67
+ tado_interface = Tado("my@username.com", "mypassword")
68
+
69
+ with self.assertRaises(Exception) as context:
70
+ tado_interface.get_me()
71
+
72
+ self.assertIn("API Error", str(context.exception))
File without changes
File without changes
File without changes
File without changes