コード例 #1
0
 def test_get_session_without_region(self):
     in_five_min_epoch = int(time.time()) + 5 * 60
     aws_credentials = AWSCredentials(
         access_key_id="test",
         secret_access_key="test",
         session_token="test",
         expiration=in_five_min_epoch,
     )
     session = aws_credentials.get_session()
     self.assertIsNone(session.region_name)
コード例 #2
0
 def test_get_session_with_region(self):
     in_five_min_epoch = int(time.time()) + 5 * 60
     aws_credentials = AWSCredentials(
         access_key_id="test",
         secret_access_key="test",
         session_token="test",
         expiration=in_five_min_epoch,
     )
     session = aws_credentials.get_session(region_name="us-east-4")
     self.assertEqual(session.region_name, "us-east-4")