Fix the wrong use of variable assertions in unit tests

When comparing variables, should use assertEqual

Closed-Bug: #2002460

Change-Id: Iec2e9eec8fea6e5453704c22235fb860211af1a3
This commit is contained in:
zhangtongjian 2023-01-12 09:02:11 +08:00 committed by Wenping Song
parent 05505927a5
commit eafcc2fc64
2 changed files with 3 additions and 3 deletions

View File

@ -97,7 +97,7 @@ class TestDeviceProfileController(v2_test.APITestV2):
result = isinstance(out_dps, list)
self.assertTrue(result)
self.assertTrue(len(out_dps), len(self.fake_dp_objs))
self.assertEqual(len(out_dps), len(self.fake_dp_objs))
for in_dp, out_dp in zip(self.fake_dp_objs, out_dps):
self._validate_dp(in_dp, out_dp)
@ -112,7 +112,7 @@ class TestDeviceProfileController(v2_test.APITestV2):
result = isinstance(out_dps, list)
self.assertTrue(result)
self.assertTrue(len(out_dps), len(expected_dps))
self.assertEqual(len(out_dps), len(expected_dps))
for in_dp, out_dp in zip(expected_dps, out_dps):
self._validate_dp(in_dp, out_dp)

View File

@ -64,7 +64,7 @@ class TestDevicesController(v2_test.APITestV2):
self.assertIsInstance(out_devices, list)
for out_dev in out_devices:
self.assertIsInstance(out_dev, dict)
self.assertTrue(len(out_devices), len(self.fake_devices))
self.assertEqual(len(out_devices), len(self.fake_devices))
for in_device, out_device in zip(self.fake_devices, out_devices):
self._validate_device(in_device, out_device)