Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DinisCruz committed Jun 2, 2024
1 parent 5824de6 commit 786325b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions tests/integration/aws/bedrock/cache/test_Bedrock__Cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,12 @@ def test_models(self):
response_data = [0,1,2,3]
new_cache_entry = self.bedrock_cache.create_new_cache_row_data(request_data, response_data)
expected_cache_entry = { **new_cache_entry,
'id' : 1 ,
'timestamp' : 0 }
'comments' : '' ,
'id' : 1 ,
'metadata' : '' ,
'request_type': '' ,
'source' : '' ,
'timestamp' : 0 }
bedrock = Mock()
bedrock.models.return_value = response_data
models = self.bedrock_cache.models(bedrock)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,19 @@ def test_create_new_cache_data(self):
response_data = {'the': 'return value'}
request_data = self.bedrock_cache.cache_request_data(model_id, body)
new_cache_entry = self.bedrock_cache.create_new_cache_row_data(request_data, response_data)
expected_new_cache_entry = {'comments' : '' ,
'metadata' : '' ,
'request_data' : json_dumps(request_data) ,
expected_new_cache_entry = {'request_data' : json_dumps(request_data) ,
'request_hash' : '1b16c63a54a704c20df7c449d04acb56f8c8d44a48e1d43bee20359536edcd71' ,
'request_type' : '' ,
'response_bytes': b'' ,
'response_data' : json_dumps(response_data) ,
'response_hash' : '69e330ec7bf6334aa41ecaf56797fa86345d3cf85da4c622821aa42d4bee1799' ,
'response_type' : 'dict' ,
'source' : '' ,
'timestamp' : 0 }
expected_new_cache_obj = { **expected_new_cache_entry,
'timestamp' : 0 }
'comments' : '' ,
'metadata' : '' ,
'request_type': '' ,
'source' : '' ,
'timestamp' : 0 }
assert new_cache_entry == expected_new_cache_entry
new_cache_obj = self.bedrock_cache.cache_table().new_row_obj(new_cache_entry)
assert new_cache_obj.__locals__() == expected_new_cache_obj
Expand Down

0 comments on commit 786325b

Please sign in to comment.