Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Feature/aes signature #50

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
delete unused code
  • Loading branch information
YoungWing committed Nov 10, 2022
commit 19c1bdfb053b3a06d88fdf3116a108043a083c34
2 changes: 2 additions & 0 deletions aftership/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ def get_aftership_api_key():
return aftership.api_key
return os.getenv('AFTERSHIP_API_KEY')


def get_as_api_key():
"""Get AS API key"""
if aftership.api_key is not None:
return aftership.api_key
return os.getenv('AS_API_KEY')


def get_as_api_secret():
"""Get AfterShip API secret"""
if aftership.api_secret is not None:
Expand Down
2 changes: 0 additions & 2 deletions tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ class UtilsTestCase(TestCase):
@pytest.mark.vcr()
def test_get_key(self):
api_key = '12345678'
print("test_get_key==============", api_key)
aftership.api_key = api_key
self.assertEqual(aftership.api_key, api_key)
self.assertEqual(aftership.api_key, get_aftership_api_key())

@pytest.mark.vcr()
def test_get_secret(self):
api_secret = '12345678'
print("api_secret==============", api_secret)
aftership.api_secret = api_secret
self.assertEqual(aftership.api_secret, api_secret)
self.assertEqual(aftership.api_secret, get_as_api_secret())