From 95c1dfb0897a4073c3759fa51b0191d9670dc97f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 27 Nov 2023 01:02:39 +0100 Subject: [PATCH] [tests] swap assertEqual argument order before this, it would show test failures as + test value - extracted value when it should be the other way round --- test/test_results.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/test_results.py b/test/test_results.py index 182509f5..c7a50019 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -192,22 +192,22 @@ class TestExtractorResults(unittest.TestCase): subtest = True self._test_kwdict(value[idx], item) if not subtest: - self.assertEqual(value, test, msg=key) + self.assertEqual(test, value, msg=key) elif isinstance(test, str): if test.startswith("re:"): self.assertRegex(value, test[3:], msg=key) elif test.startswith("dt:"): self.assertIsInstance(value, datetime.datetime, msg=key) - self.assertEqual(str(value), test[3:], msg=key) + self.assertEqual(test[3:], str(value), msg=key) elif test.startswith("type:"): - self.assertEqual(type(value).__name__, test[5:], msg=key) + self.assertEqual(test[5:], type(value).__name__, msg=key) elif test.startswith("len:"): self.assertIsInstance(value, (list, tuple), msg=key) - self.assertEqual(len(value), int(test[4:]), msg=key) + self.assertEqual(int(test[4:]), len(value), msg=key) else: - self.assertEqual(value, test, msg=key) + self.assertEqual(test, value, msg=key) else: - self.assertEqual(value, test, msg=key) + self.assertEqual(test, value, msg=key) class ResultJob(job.DownloadJob):