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.
- {python_tado-0.18.0/python_tado.egg-info → python_tado-0.18.1}/PKG-INFO +3 -1
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/http.py +1 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/interface/interface.py +1 -1
- {python_tado-0.18.0 → python_tado-0.18.1}/pyproject.toml +2 -2
- {python_tado-0.18.0 → python_tado-0.18.1/python_tado.egg-info}/PKG-INFO +3 -1
- {python_tado-0.18.0 → python_tado-0.18.1}/python_tado.egg-info/SOURCES.txt +2 -1
- {python_tado-0.18.0 → python_tado-0.18.1}/python_tado.egg-info/requires.txt +2 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/tests/test_my_zone.py +1 -1
- python_tado-0.18.1/tests/test_tado_interface.py +72 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/AUTHORS +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/LICENSE +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/__init__.py +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/__main__.py +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/const.py +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/exceptions.py +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/interface/__init__.py +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/interface/api/__init__.py +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/interface/api/hops_tado.py +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/interface/api/my_tado.py +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/logging.py +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/zone/__init__.py +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/zone/hops_zone.py +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/PyTado/zone/my_zone.py +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/README.md +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/python_tado.egg-info/dependency_links.txt +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/python_tado.egg-info/entry_points.txt +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/python_tado.egg-info/not-zip-safe +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/python_tado.egg-info/top_level.txt +0 -0
- {python_tado-0.18.0 → python_tado-0.18.1}/setup.cfg +0 -0
- {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.
|
|
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
|
========================================
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-tado"
|
|
7
|
-
version = "0.18.
|
|
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.
|
|
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
|
========================================
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|