tplinkrouterc6u 5.2.0__py3-none-any.whl → 5.2.1__py3-none-any.whl

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.
test/test_client_xdr.py CHANGED
@@ -13,6 +13,54 @@ from tplinkrouterc6u.common.package_enum import Connection
13
13
 
14
14
 
15
15
  class TestTPLinkXDRClient(TestCase):
16
+
17
+ def test_supports_false(self) -> None:
18
+ class SessionTest:
19
+ def get(self, host, timeout, verify):
20
+ class ResponseTest:
21
+ def __init__(self):
22
+ self.text = 'text'
23
+
24
+ return ResponseTest()
25
+
26
+ client = TPLinkXDRClient('', '')
27
+ client._session = SessionTest()
28
+
29
+ self.assertEqual(client.supports(), False)
30
+
31
+ def test_supports_true(self) -> None:
32
+ response = '''<!DOCTYPE html>
33
+ <html xmlns="http://www.w3.org/1999/xhtml">
34
+ <head>
35
+ <title>TL-XDR3010易展版</title>
36
+ <meta name="MobileOptimized" content="240" />
37
+ <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=0.5,
38
+ maximum-scale=2.0, user-scalable=yes" />
39
+ <link rel="shortcut Icon" href="../web-static/images/icon.ico" type="image/x-icon" />
40
+ <link rel="stylesheet" href="../web-static/dynaform/class.css">
41
+ <script type="text/javascript" src="../web-static/dynaform/class.js"></script>
42
+ <script type="text/javascript" src="../web-static/dynaform/jtopo.js"></script>
43
+ </head>
44
+ <body><div id="Error"></div><div id="Confirm"></div><div id="Con"></div><div id="Help"></div><div id="Cover"></div>
45
+ <div id="Login"></div><script type="text/javascript">var gBeInCNA = "NO";var proName="TL-XDR3010易展版";pageOnload();
46
+ </script>
47
+ </body>
48
+ </html>
49
+ '''
50
+
51
+ class SessionTest:
52
+ def get(self, host, timeout, verify):
53
+ class ResponseTest:
54
+ def __init__(self):
55
+ self.text = response
56
+
57
+ return ResponseTest()
58
+
59
+ client = TPLinkXDRClient('', '')
60
+ client._session = SessionTest()
61
+
62
+ self.assertEqual(client.supports(), True)
63
+
16
64
  def test_logout(self) -> None:
17
65
  mock_data = json.loads('''{"error_code":0}''')
18
66
  check_payload = {}
@@ -25,7 +25,7 @@ class TPLinkXDRClient(AbstractRouter):
25
25
 
26
26
  def supports(self) -> bool:
27
27
  response = self._session.get(self.host, timeout=self.timeout, verify=self._verify_ssl)
28
- return response.text.index('TL-XDR') >= 0
28
+ return 'TL-XDR' in response.text
29
29
 
30
30
  def authorize(self) -> None:
31
31
  response = self._session.post(self.host, json={
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tplinkrouterc6u
3
- Version: 5.2.0
3
+ Version: 5.2.1
4
4
  Summary: TP-Link Router API
5
5
  Home-page: https://github.com/AlexandrErohin/TP-Link-Archer-C6U
6
6
  Author: Alex Erohin
@@ -4,7 +4,7 @@ test/test_client_c6u.py,sha256=qC0PNE-Hz3d8PYIGej4j_M4cLDqffnPiXu_ff7Ft29M,30709
4
4
  test/test_client_deco.py,sha256=ur4u-pWB-6WaYW6PSpK9OvCg3rfo2x06V5Cf_eE2UYU,30447
5
5
  test/test_client_ex.py,sha256=cSIMh6yjiAknt0mk7u1dCpXVzZTR_Y95XvXRBRusbpg,17092
6
6
  test/test_client_mr.py,sha256=Uomg3T_SA5Y1tb4wlniMKQDi_uJ2Vqm30I-GKgOXBRc,32703
7
- test/test_client_xdr.py,sha256=G64aS5yvjuFMImvTzVTcbI4-FVOJY_hm8d0y69H-1Gc,18965
7
+ test/test_client_xdr.py,sha256=Tm3fXAmSxa8F_YNv66eN3zSvy2GKi_q6tuuw8GWqL-c,20698
8
8
  tplinkrouterc6u/__init__.py,sha256=bLlCkiL9ycyRVG7VqPOJWPcoPmUfMkdTcUKFYKNP8QI,900
9
9
  tplinkrouterc6u/client_abstract.py,sha256=OgftTH6bELzhFWom0MOX4EJe3RNS003ezpHyyRnh2tQ,1328
10
10
  tplinkrouterc6u/provider.py,sha256=SsyGu_2SZ-a46ADl9aw_0wx0lgbsJhS6wnwUzb_1qGg,1900
@@ -16,15 +16,15 @@ tplinkrouterc6u/client/c6v4.py,sha256=-IF7SqTZx56lRAVmiyxK9VKkrmD7srQSJWFvn2Z0DI
16
16
  tplinkrouterc6u/client/deco.py,sha256=0Hwy_kVQshYd-5Oa3mIASaZI_4NUD09NFEdRyPtzjdI,8265
17
17
  tplinkrouterc6u/client/ex.py,sha256=jkxCgqbjp-SfjlzgKeNj4WhV3v9gEOzKgrgfVgy9SB4,11604
18
18
  tplinkrouterc6u/client/mr.py,sha256=1-aP8xo5JUiFzKmeyOjolzyKR_yIUwTBrRG562tmfAg,25638
19
- tplinkrouterc6u/client/xdr.py,sha256=1YWM00OSTTj3XCJ2bINf2qU3yQZmORmWzLqFwOVqC_0,9782
19
+ tplinkrouterc6u/client/xdr.py,sha256=lqsBGxi9wZsz1IqQ9KZjAY6gd9-IgK0Cm2oRaswYFSs,9773
20
20
  tplinkrouterc6u/common/__init__.py,sha256=pCTvVZ9CAwgb7MxRnLx0y1rI0sTKSwT24FfxWfQXeTM,33
21
21
  tplinkrouterc6u/common/dataclass.py,sha256=__u8I8URLk_AdIEN4Jd8Pswh4ujURlJxw8YunuVStwk,7630
22
22
  tplinkrouterc6u/common/encryption.py,sha256=4HelTxzN6esMfDZRBt3m8bwB9Nj_biKijnCnrGWPWKg,6228
23
23
  tplinkrouterc6u/common/exception.py,sha256=_0G8ZvW5__CsGifHrsZeULdl8c6EUD071sDCQsQgrHY,140
24
24
  tplinkrouterc6u/common/helper.py,sha256=phcPUdpY7lJVWF8Ih4KHNdsdem2ed6qFSDXuEAtAgug,334
25
25
  tplinkrouterc6u/common/package_enum.py,sha256=py31wF7SntZ0D_o0PS7az29wtsWdp0r0uE7QMmiWigY,1451
26
- tplinkrouterc6u-5.2.0.dist-info/LICENSE,sha256=YF6QR6Vjxcg5b_sYIyqkME7FZYau5TfEUGTG-0JeRK0,35129
27
- tplinkrouterc6u-5.2.0.dist-info/METADATA,sha256=yDOAsf0yPwBDG8Xius3t5HpaSkwkxeFUHVdJtVYZSlA,14917
28
- tplinkrouterc6u-5.2.0.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
29
- tplinkrouterc6u-5.2.0.dist-info/top_level.txt,sha256=1iSCCIueqgEkrTxtQ-jiHe99jAB10zqrVdBcwvNfe_M,21
30
- tplinkrouterc6u-5.2.0.dist-info/RECORD,,
26
+ tplinkrouterc6u-5.2.1.dist-info/LICENSE,sha256=YF6QR6Vjxcg5b_sYIyqkME7FZYau5TfEUGTG-0JeRK0,35129
27
+ tplinkrouterc6u-5.2.1.dist-info/METADATA,sha256=KqphtW9gVYMljs9l84CGB6uwutisAIQesbE0ixlSTuA,14917
28
+ tplinkrouterc6u-5.2.1.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
29
+ tplinkrouterc6u-5.2.1.dist-info/top_level.txt,sha256=1iSCCIueqgEkrTxtQ-jiHe99jAB10zqrVdBcwvNfe_M,21
30
+ tplinkrouterc6u-5.2.1.dist-info/RECORD,,