Best Python code snippet using localstack_python
test_sync.py
Source:test_sync.py
...42 AWS_COGNITO_USERPOOL_ID,43 testmode=True44 )45 assert isinstance(claims, dict)46def test_get_public_key():47 pub_key = cognitojwt.jwt_sync.get_public_key(48 TEST_ACCESS_TOKEN,49 AWS_COGNITO_REGION,50 AWS_COGNITO_USERPOOL_ID51 )52 assert isinstance(pub_key, RSAKey)53def test_get_public_key():54 keys_url = PUBLIC_KEYS_URL_TEMPLATE.format(AWS_COGNITO_REGION, AWS_COGNITO_USERPOOL_ID)55 r = requests.get(keys_url)56 keys_response = r.text57 with tempfile.NamedTemporaryFile(suffix='.json') as tf:58 tf.write(keys_response.encode('utf-8'))59 tf.seek(0)60 os.environ['AWS_COGNITO_JWKS_PATH'] = tf.name61 pub_key = cognitojwt.jwt_sync.get_public_key(62 TEST_ACCESS_TOKEN,63 AWS_COGNITO_REGION,64 AWS_COGNITO_USERPOOL_ID65 )66 del os.environ['AWS_COGNITO_JWKS_PATH']67 assert isinstance(pub_key, RSAKey)
test_pkcs11_manager.py
Source:test_pkcs11_manager.py
...14 get_key_key = mock.MagicMock()15 get_key_attrib = mock.MagicMock()16 HSM_MANAGER_test.get_key(get_key_key, get_key_attrib)17'''test_get_public_key'''18def test_get_public_key():19 init_cfg_file = mock.MagicMock()20 HSM_MANAGER_test = HSM_MANAGER(init_cfg_file)21 get_public_key_public_key = mock.MagicMock()22 HSM_MANAGER_test.get_public_key(get_public_key_public_key)23'''test_sign'''24def test_sign():25 init_cfg_file = mock.MagicMock()26 HSM_MANAGER_test = HSM_MANAGER(init_cfg_file)27 sign_sha = mock.MagicMock()28 sign_key = mock.MagicMock()29 HSM_MANAGER_test.sign(sign_sha, sign_key)30'''test_get_X_Y'''31def test_get_X_Y():32 init_xy = mock.MagicMock()...
test_pubkey_cmd.py
Source:test_pubkey_cmd.py
1def test_get_public_key(cmd):2 pub_key, chain_code = cmd.get_public_key(3 bip32_path="m/44'/0'/0'/0/0",4 display=False5 ) # type: bytes, bytes6 assert len(pub_key) == 657 assert len(chain_code) == 328 pub_key2, chain_code2 = cmd.get_public_key(9 bip32_path="m/44'/1'/0'/0/0",10 display=False11 ) # type: bytes, bytes12 assert len(pub_key2) == 65...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!