mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-14 05:49:57 +00:00
python3-cbor2: more patch indent and test fixes
Similar to a previous patch, the CVE-2025-68131 patch contained some more indentation errors, in the tests. Also, the backported tests were inserted between an existing test and its parameters - a new patch corrects that. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
This commit is contained in:
@@ -411,7 +411,7 @@ index d03e288..cc3af11 100644
|
||||
+ decoder.decode_from_bytes(msg2)
|
||||
+
|
||||
+ def test_shared_refs_within_single_decode(self, impl):
|
||||
+ """
|
||||
+ """
|
||||
+ Shared references must work correctly within a single decode operation.
|
||||
+
|
||||
+ Note: This tests non-cyclic sibling references [shareable(x), sharedref(0)],
|
||||
@@ -420,7 +420,7 @@ index d03e288..cc3af11 100644
|
||||
+ """
|
||||
+ # [shareable("hello"), sharedref(0)] -> ["hello", "hello"]
|
||||
+ data = unhexlify(
|
||||
+ "82" # array(2)
|
||||
+ "82" # array(2)
|
||||
+ "d81c" # tag(28) shareable
|
||||
+ "65" # text(5)
|
||||
+ "68656c6c6f" # "hello"
|
||||
@@ -475,7 +475,7 @@ index 8c40000..c76d5e0 100644
|
||||
+ encode_to_bytes should also reset shared container tracking between calls.
|
||||
+ """
|
||||
+ fp = BytesIO()
|
||||
+ encoder = impl.CBOREncoder(fp, value_sharing=True)
|
||||
+ encoder = impl.CBOREncoder(fp, value_sharing=True)
|
||||
+ shared_obj = ["hello"]
|
||||
+
|
||||
+ # First encode
|
||||
@@ -483,7 +483,7 @@ index 8c40000..c76d5e0 100644
|
||||
+
|
||||
+ # Second encode should produce valid standalone CBOR
|
||||
+ result_bytes = encoder.encode_to_bytes(shared_obj)
|
||||
+ result = impl.loads(result_bytes)
|
||||
+ result = impl.loads(result_bytes)
|
||||
+ assert result == ["hello"]
|
||||
+
|
||||
+ def test_encoder_hook_does_not_reset_state(self, impl):
|
||||
|
||||
Reference in New Issue
Block a user