Skip to content
Snippets Groups Projects
Commit e8303697 authored by Sergio Durigan Junior's avatar Sergio Durigan Junior
Browse files

d/p/0006-Replace-deprecated-assertDictContainsSubset.patch:

Replace deprecated assertDictContainsSubset with assertLessEqual.

Closes: #1056482
parent b061981d
No related branches found
No related tags found
No related merge requests found
From: Sergio Durigan Junior <sergiodj@debian.org>
Date: Tue, 23 Jan 2024 09:56:43 -0500
Subject: Replace deprecated assertDictContainsSubset
The method was deprecated in Python 3.2. Replace it with
assertLessEqual, which uses set logic to perform the same operation.
Signed-off-by: Sergio Durigan Junior <sergiodj@debian.org>
Forwarded: yes, https://github.com/ARMmbed/mbed-os-tools/pull/288
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1056482
---
test/mbedls_toolsbase.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/mbedls_toolsbase.py b/test/mbedls_toolsbase.py
index 4509826..f35ab89 100644
--- a/test/mbedls_toolsbase.py
+++ b/test/mbedls_toolsbase.py
@@ -422,7 +422,7 @@ Remount count: 0
self.assertIsNotNone(ret_with_details[0])
self.assertEqual(ret[0]['target_id'], new_device_id)
self.assertEqual(ret_with_details[0]['daplink_automation_allowed'], '0')
- self.assertDictContainsSubset(ret[0], ret_with_details[0])
+ self.assertLessEqual(ret[0].items(), ret_with_details[0].items())
_read_htm.assert_called_with(device['mount_point'])
_up_details.assert_called_with(device['mount_point'])
@@ -498,7 +498,7 @@ Remount count: 0
self.assertIsNotNone(ret_with_details[0])
self.assertEqual(ret[0]['target_id'], new_device_id)
self.assertEqual(ret_with_details[0]['daplink_automation_allowed'], '0')
- self.assertDictContainsSubset(ret[0], ret_with_details[0])
+ self.assertLessEqual(ret[0].items(), ret_with_details[0].items())
_read_htm.assert_called_with(device['mount_point'])
_up_details.assert_called_with(device['mount_point'])
@@ -520,7 +520,7 @@ Remount count: 0
self.assertIsNotNone(ret_with_details[0])
self.assertEqual(ret[0]['target_id'], new_device_id)
self.assertEqual(ret_with_details[0]['daplink_automation_allowed'], '0')
- self.assertDictContainsSubset(ret[0], ret_with_details[0])
+ self.assertLessEqual(ret[0].items(), ret_with_details[0].items())
_read_htm.assert_called_with(device['mount_point'])
_up_details.assert_called_with(device['mount_point'])
......@@ -3,3 +3,4 @@ skip-database-tests
fix-syntaxwarnings-is-with-literals
relax-setup-py-dependency-versions
setuptools-60
0006-Replace-deprecated-assertDictContainsSubset.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment