python-terminusgps 37.5.2__py3-none-any.whl → 37.6.0__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.
- {python_terminusgps-37.5.2.dist-info → python_terminusgps-37.6.0.dist-info}/METADATA +1 -1
- {python_terminusgps-37.5.2.dist-info → python_terminusgps-37.6.0.dist-info}/RECORD +6 -10
- terminusgps/authorizenet/auth.py +2 -3
- terminusgps/django/settings.py +4 -0
- terminusgps/wialon/tests/__init__.py +0 -0
- terminusgps/wialon/tests/test_items.py +0 -0
- terminusgps/wialon/tests/test_session.py +0 -42
- terminusgps/wialon/tests/test_utils.py +0 -41
- {python_terminusgps-37.5.2.dist-info → python_terminusgps-37.6.0.dist-info}/WHEEL +0 -0
- {python_terminusgps-37.5.2.dist-info → python_terminusgps-37.6.0.dist-info}/licenses/COPYING +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version: 37.
|
|
3
|
+
Version: 37.6.0
|
|
4
4
|
Summary: Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more.
|
|
5
5
|
Project-URL: Documentation, https://docs.terminusgps.com
|
|
6
6
|
Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
terminusgps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
terminusgps/authorizenet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
terminusgps/authorizenet/auth.py,sha256=
|
|
3
|
+
terminusgps/authorizenet/auth.py,sha256=CKT_pfDEL-53GceOEaFtIU6IBXVuVd8MVHikpPAX0xY,1184
|
|
4
4
|
terminusgps/authorizenet/constants.py,sha256=uXkYVmQPrnYBDfGahVEmzwTny21A8jGcrH7qfSdLhvc,512
|
|
5
5
|
terminusgps/authorizenet/controllers.py,sha256=rMuBwSoKJjte7wVuB1ewaqnzfuDXxwus-d5mkqbfnGE,2193
|
|
6
6
|
terminusgps/authorizenet/utils.py,sha256=lkXjKfegFFN8TgtjlyI03416X6oqFIciFnWgSEuIgSM,6800
|
|
@@ -27,7 +27,7 @@ terminusgps/aws/tests/test_notifications.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
|
|
|
27
27
|
terminusgps/aws/tests/test_secrets.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
terminusgps/django/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
29
|
terminusgps/django/mixins.py,sha256=Q9ZJuzpk3d9lDnlVA8ZTVvnZWxB13p08EQ8yVJcztn4,1034
|
|
30
|
-
terminusgps/django/settings.py,sha256=
|
|
30
|
+
terminusgps/django/settings.py,sha256=OxfagnSI6Ra8bte0viGYk9kr5KHGs8dvP2iN1ykjC7U,896
|
|
31
31
|
terminusgps/django/utils.py,sha256=SYDQyHA5tTuVwdpZGsCtf0LpTTD0ilRKoxa8StfSTpQ,156
|
|
32
32
|
terminusgps/django/validators.py,sha256=Gx-bpWkfI0fM4WXVRUpoC2ihPqs7agjdHAFO6gralCs,3341
|
|
33
33
|
terminusgps/django/forms/__init__.py,sha256=hh8Z9AC_u2m2bu3h6sdmPyndfQneCEVovENPHmoTDC0,21
|
|
@@ -55,11 +55,7 @@ terminusgps/wialon/items/route.py,sha256=2dEUK9o8nwutPE03W-5GUcZrjGvbwLoExVnFV9L
|
|
|
55
55
|
terminusgps/wialon/items/unit.py,sha256=P828NaWkTQncNre3n4h7AedeSxUXPKSxQFpBiliZCBk,12133
|
|
56
56
|
terminusgps/wialon/items/unit_group.py,sha256=HhYMZ9b7UATXeEgHkXN9r5-M_w82fabjDYADCUwBtxQ,4442
|
|
57
57
|
terminusgps/wialon/items/user.py,sha256=pR6OTrm6f7Zo0J8eLvKtWVsdhGi430OxMsMMthGh8YE,5382
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
python_terminusgps-37.5.2.dist-info/METADATA,sha256=rs7iVZ9GR7e21fCHspgV86OVQ2cKErylAeGzzsFMk9c,1329
|
|
63
|
-
python_terminusgps-37.5.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
64
|
-
python_terminusgps-37.5.2.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
65
|
-
python_terminusgps-37.5.2.dist-info/RECORD,,
|
|
58
|
+
python_terminusgps-37.6.0.dist-info/METADATA,sha256=U0nwkLtDzZOqO0_pNUbqDbuJHfy1fQnn57xw2_W2j2Y,1329
|
|
59
|
+
python_terminusgps-37.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
60
|
+
python_terminusgps-37.6.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
61
|
+
python_terminusgps-37.6.0.dist-info/RECORD,,
|
terminusgps/authorizenet/auth.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from authorizenet.apicontractsv1 import merchantAuthenticationType
|
|
2
|
-
from authorizenet.constants import constants
|
|
3
2
|
from django.conf import settings
|
|
4
3
|
|
|
5
4
|
from terminusgps.django import settings as default_settings
|
|
@@ -30,7 +29,7 @@ def get_environment() -> str:
|
|
|
30
29
|
:rtype: :py:obj:`str`
|
|
31
30
|
|
|
32
31
|
"""
|
|
33
|
-
return
|
|
32
|
+
return settings.MERCHANT_AUTH_ENVIRONMENT
|
|
34
33
|
|
|
35
34
|
|
|
36
35
|
def get_validation_mode() -> str:
|
|
@@ -41,4 +40,4 @@ def get_validation_mode() -> str:
|
|
|
41
40
|
:rtype: :py:obj:`str`
|
|
42
41
|
|
|
43
42
|
"""
|
|
44
|
-
return
|
|
43
|
+
return settings.MERCHANT_AUTH_VALIDATION_MODE
|
terminusgps/django/settings.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import pathlib
|
|
3
3
|
|
|
4
|
+
from authorizenet.constants import constants
|
|
5
|
+
|
|
4
6
|
BASE_DIR = pathlib.Path(__file__).resolve().parent
|
|
5
7
|
DEBUG = True
|
|
6
8
|
SECRET_KEY = "xem*6no%8d9%^qzt2f3x3ar-uq4_+7h9myc$t0!+4%bj5us6f)"
|
|
@@ -10,6 +12,8 @@ USE_TZ = False
|
|
|
10
12
|
CONNECT_SECRET = os.getenv("CONNECT_SECRET")
|
|
11
13
|
MERCHANT_AUTH_LOGIN_ID = os.getenv("MERCHANT_AUTH_LOGIN_ID")
|
|
12
14
|
MERCHANT_AUTH_TRANSACTION_KEY = os.getenv("MERCHANT_AUTH_TRANSACTION_KEY")
|
|
15
|
+
MERCHANT_AUTH_ENVIRONMENT = constants.SANDBOX
|
|
16
|
+
MERCHANT_AUTH_VALIDATION_MODE = "testMode"
|
|
13
17
|
TWILIO_FROM_NUMBER = os.getenv("TWILIO_FROM_NUMBER")
|
|
14
18
|
TWILIO_MESSAGING_SID = os.getenv("TWILIO_MESSAGING_SID")
|
|
15
19
|
TWILIO_SID = os.getenv("TWILIO_SID")
|
|
File without changes
|
|
File without changes
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import unittest
|
|
3
|
-
|
|
4
|
-
from django.conf import settings
|
|
5
|
-
|
|
6
|
-
from terminusgps.wialon.session import WialonSession
|
|
7
|
-
|
|
8
|
-
TEST_WIALON_TOKEN = os.getenv("WIALON_TOKEN") or settings.WIALON_TOKEN
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class WialonSessionTestCase(unittest.TestCase):
|
|
12
|
-
def setUp(self) -> None:
|
|
13
|
-
self.token = TEST_WIALON_TOKEN
|
|
14
|
-
self.session = WialonSession()
|
|
15
|
-
|
|
16
|
-
def tearDown(self) -> None:
|
|
17
|
-
if self.session.active:
|
|
18
|
-
self.session.logout()
|
|
19
|
-
|
|
20
|
-
def test_session_init(self) -> None:
|
|
21
|
-
self.assertIsNone(self.session.id)
|
|
22
|
-
self.assertIsNone(self.session.username)
|
|
23
|
-
self.assertIsNone(self.session.uid)
|
|
24
|
-
|
|
25
|
-
def test_session_login(self) -> None:
|
|
26
|
-
sid: str = self.session.login(self.token)
|
|
27
|
-
self.assertEqual(self.session.id, sid)
|
|
28
|
-
|
|
29
|
-
def test_session_logout(self) -> None:
|
|
30
|
-
self.session.login(self.token)
|
|
31
|
-
self.session.logout()
|
|
32
|
-
self.assertIsNone(self.session.id, None)
|
|
33
|
-
|
|
34
|
-
def test_session_bad_call(self) -> None:
|
|
35
|
-
self.session.login(self.token)
|
|
36
|
-
response = self.session.wialon_api.core_bad_call({})
|
|
37
|
-
self.assertIsNone(response)
|
|
38
|
-
|
|
39
|
-
def test_session_valid_call_count(self) -> None:
|
|
40
|
-
self.session.login(self.token) # Login/logout does not count
|
|
41
|
-
self.session.wialon_api.avl_evts()
|
|
42
|
-
self.assertEqual(self.session.wialon_api.total_calls, 1)
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import string
|
|
2
|
-
import unittest
|
|
3
|
-
|
|
4
|
-
from terminusgps.wialon import utils
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class WialonUtilsTestCase(unittest.TestCase):
|
|
8
|
-
def test_generate_wialon_password_min_length(self) -> None:
|
|
9
|
-
with self.assertRaises(ValueError) as context:
|
|
10
|
-
utils.generate_wialon_password(length=7)
|
|
11
|
-
self.assertTrue(
|
|
12
|
-
"Password cannot be less than 8 characters in length, got 7."
|
|
13
|
-
in str(context.exception)
|
|
14
|
-
)
|
|
15
|
-
|
|
16
|
-
def test_generate_wialon_password_max_length(self) -> None:
|
|
17
|
-
with self.assertRaises(ValueError) as context:
|
|
18
|
-
utils.generate_wialon_password(length=65)
|
|
19
|
-
self.assertTrue(
|
|
20
|
-
"Password cannot be greater than 64 characters in length, got 65."
|
|
21
|
-
in str(context.exception)
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
def test_generate_wialon_password_valid(self) -> None:
|
|
25
|
-
password = utils.generate_wialon_password()
|
|
26
|
-
s0 = list(string.ascii_uppercase)
|
|
27
|
-
s1 = list(string.ascii_lowercase)
|
|
28
|
-
s2 = list(string.digits)
|
|
29
|
-
s3 = list("!@#$%^*()[]-_+")
|
|
30
|
-
|
|
31
|
-
if len(password) < 8 or len(password) > 64:
|
|
32
|
-
self.fail(f"Generated password was {len(password)} chars in length.")
|
|
33
|
-
if not any([c for c in password if c in s0]):
|
|
34
|
-
self.fail("Generated password did not contain an uppercase letter.")
|
|
35
|
-
if not any([c for c in password if c in s1]):
|
|
36
|
-
self.fail("Generated password did not contain a lowercase letter.")
|
|
37
|
-
# TODO: Make this check for 3 digits
|
|
38
|
-
if not any([c for c in password if c in s2]):
|
|
39
|
-
self.fail("Generated password did not contain a digit.")
|
|
40
|
-
if not any([c for c in password if c in s3]):
|
|
41
|
-
self.fail("Generated password did not contain a special symbol.")
|
|
File without changes
|
{python_terminusgps-37.5.2.dist-info → python_terminusgps-37.6.0.dist-info}/licenses/COPYING
RENAMED
|
File without changes
|