Skip to content

Commit ad2e47f

Browse files
authored
chore: add unit test for param store cognito login (#74)
1 parent 80742de commit ad2e47f

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

tests/lib/__init__.py

Whitespace-only changes.

tests/lib/cognito_login/__init__.py

Whitespace-only changes.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import os
2+
from unittest import TestCase
3+
4+
from cumulus_lambda_functions.lib.cognito_login.cognito_token_retriever import CognitoTokenRetriever
5+
from cumulus_lambda_functions.lib.constants import Constants
6+
7+
8+
class TestCognitoTokenRetriever(TestCase):
9+
def test_param_store_01(self):
10+
# os.environ['AWS_ACCESS_KEY_ID'] = 'dd'
11+
# os.environ['AWS_SECRET_ACCESS_KEY'] = 'ddd'
12+
# os.environ['AWS_SESSION_TOKEN'] = 'ddd'
13+
# os.environ['AWS_REGION'] = 'us-west-2'
14+
15+
16+
os.environ[Constants.USERNAME] = '/unity/uds/user/wphyo/username'
17+
os.environ[Constants.PASSWORD] = '/unity/uds/user/wphyo/dwssap'
18+
# os.environ[Constants.USERNAME] = 'usps_username'
19+
# os.environ[Constants.PASSWORD] = 'usps_password'
20+
os.environ[Constants.PASSWORD_TYPE] = Constants.PARAM_STORE
21+
os.environ[Constants.CLIENT_ID] = '7a1fglm2d54eoggj13lccivp25' # JPL Cloud
22+
os.environ[Constants.CLIENT_ID] = '6ir9qveln397i0inh9pmsabq1' # MCP Test Cloud
23+
24+
os.environ[Constants.COGNITO_URL] = 'https://cognito-idp.us-west-2.amazonaws.com'
25+
result = CognitoTokenRetriever().start()
26+
self.assertTrue(len(result) > 0, 'empty token')
27+
return

0 commit comments

Comments
 (0)