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)
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")