Skip to content

Commit 8059b5f

Browse files
Refactoring tests
1 parent ffaf334 commit 8059b5f

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

aws_lambda_powertools/utilities/kafka/deserializer/base.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,4 @@ def deserialize(self, data: str) -> dict[str, Any] | str | object:
4949
raise NotImplementedError("Subclasses must implement the deserialize method")
5050

5151
def _decode_input(self, data: bytes | str) -> bytes:
52-
try:
53-
return base64.b64decode(data)
54-
except Exception as e:
55-
raise TypeError(
56-
f"Expected bytes or base64-encoded string, got {type(data).__name__}. Error: {str(e)}",
57-
) from e
52+
return base64.b64decode(data)

tests/functional/kafka_consumer/required_dependencies/test_kafka_consumer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,4 +290,4 @@ def handler(event: ConsumerRecords, context):
290290
assert result.original_value == kafka_event_with_json_data["records"]["my-topic-1"][0]["value"]
291291
assert result.original_key == kafka_event_with_json_data["records"]["my-topic-1"][0]["key"]
292292
assert result.original_headers == kafka_event_with_json_data["records"]["my-topic-1"][0]["headers"]
293-
assert result.headers
293+
assert result.headers == {"headerKey": b"headerValue"}

0 commit comments

Comments
 (0)