Skip to content

Commit 6edab4c

Browse files
committed
fix: poetry lock file, bedrock test client
1 parent 6efabad commit 6edab4c

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

adalflow/poetry.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adalflow/tests/test_aws_bedrock_client.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
1+
import os
12
import unittest
23
from unittest.mock import patch, Mock
34

45
from adalflow.core.types import ModelType, GeneratorOutput
56
from adalflow.components.model_client import BedrockAPIClient
7+
from adalflow import setup_env
68

79

810
def getenv_side_effect(key):
911
# This dictionary can hold more keys and values as needed
1012
env_vars = {
11-
"AWS_ACCESS_KEY_ID": "fake_api_key",
12-
"AWS_SECRET_ACCESS_KEY": "fake_api_key",
13-
"AWS_REGION_NAME": "fake_api_key",
13+
"AWS_ACCESS_KEY_ID": "WQIWQORE2RK63VGZJKGF",
14+
"AWS_SECRET_ACCESS_KEY": "aW1dDWQKdR/Sx3fI39N6ycoAYTjj3vsPSuN44ebU",
15+
"AWS_REGION_NAME": "us-east-1",
1416
}
1517
return env_vars.get(key, None) # Returns None if key is not found
1618

1719

1820
# modified from test_openai_client.py
1921
class TestBedrockClient(unittest.TestCase):
2022
def setUp(self):
21-
self.client = BedrockAPIClient()
23+
# Patch os.environ to ensure all environment variables are set
24+
with patch.dict(os.environ, {
25+
"AWS_ACCESS_KEY_ID": "fake_api_key",
26+
"AWS_SECRET_ACCESS_KEY": "fake_api_key",
27+
"AWS_REGION_NAME": "fake_api_key",
28+
"AWS_PROFILE_NAME": "fake_profile" # Adding additional profile if needed
29+
}):
30+
# Now patch os.getenv to return mocked environment variable values
31+
with patch("os.getenv", side_effect=getenv_side_effect):
32+
self.client = BedrockAPIClient()
2233
self.mock_response = {
2334
"ResponseMetadata": {
2435
"RequestId": "43aec10a-9780-4bd5-abcc-857d12460569",

0 commit comments

Comments
 (0)