From 1932b82552bae33651b9b35382dcd4104602dcc9 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Wed, 16 Oct 2024 14:29:13 +0200 Subject: [PATCH 1/3] Changes to be commited: new file: test.txt --- test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 0000000000..e69de29bb2 From 49dbee5fd853456b345f7c210ec41b2c989badd4 Mon Sep 17 00:00:00 2001 From: GabrieleLS Date: Wed, 16 Oct 2024 14:30:57 +0200 Subject: [PATCH 2/3] Delete test.txt --- test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test.txt diff --git a/test.txt b/test.txt deleted file mode 100644 index e69de29bb2..0000000000 From 969cdce4ad48b137a02dba40b22a223b02d2c45b Mon Sep 17 00:00:00 2001 From: AntoineMamou Date: Wed, 23 Oct 2024 12:07:19 +0200 Subject: [PATCH 3/3] Fix functions in rect_test to use literal values for attribute checks --- test/rect_test.py | 56 +++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/test/rect_test.py b/test/rect_test.py index 0ad1af77c3..e916af89d7 100644 --- a/test/rect_test.py +++ b/test/rect_test.py @@ -777,13 +777,13 @@ def test_inflate__larger(self): r = Rect(2, 4, 6, 8) r2 = r.inflate(4, 6) - self.assertEqual(r.center, r2.center) - self.assertEqual(r.left - 2, r2.left) - self.assertEqual(r.top - 3, r2.top) - self.assertEqual(r.right + 2, r2.right) - self.assertEqual(r.bottom + 3, r2.bottom) - self.assertEqual(r.width + 4, r2.width) - self.assertEqual(r.height + 6, r2.height) + self.assertEqual(r2.center, (5, 8)) + self.assertEqual(r2.left, 0) + self.assertEqual(r2.top, 1) + self.assertEqual(r2.right, 10) + self.assertEqual(r2.bottom, 15) + self.assertEqual(r2.width, 10) + self.assertEqual(r2.height, 14) def test_inflate__smaller(self): """Ensures deflating a rect keeps its center the same @@ -791,13 +791,13 @@ def test_inflate__smaller(self): r = Rect(2, 4, 6, 8) r2 = r.inflate(-4, -6) - self.assertEqual(r.center, r2.center) - self.assertEqual(r.left + 2, r2.left) - self.assertEqual(r.top + 3, r2.top) - self.assertEqual(r.right - 2, r2.right) - self.assertEqual(r.bottom - 3, r2.bottom) - self.assertEqual(r.width - 4, r2.width) - self.assertEqual(r.height - 6, r2.height) + self.assertEqual((5, 8), r2.center) + self.assertEqual(4, r2.left) + self.assertEqual(7, r2.top) + self.assertEqual(6, r2.right) + self.assertEqual(9, r2.bottom) + self.assertEqual(2, r2.width) + self.assertEqual(2, r2.height) def test_inflate_ip__larger(self): """Ensures inflating a rect in place keeps its center the same @@ -806,13 +806,13 @@ def test_inflate_ip__larger(self): r2 = Rect(r) r2.inflate_ip(4, 6) - self.assertEqual(r.center, r2.center) - self.assertEqual(r.left - 2, r2.left) - self.assertEqual(r.top - 3, r2.top) - self.assertEqual(r.right + 2, r2.right) - self.assertEqual(r.bottom + 3, r2.bottom) - self.assertEqual(r.width + 4, r2.width) - self.assertEqual(r.height + 6, r2.height) + self.assertEqual(r2.center, (5, 8)) + self.assertEqual(r2.left, 0) + self.assertEqual(r2.top, 1) + self.assertEqual(r2.right, 10) + self.assertEqual(r2.bottom, 15) + self.assertEqual(r2.width, 10) + self.assertEqual(r2.height, 14) def test_inflate_ip__smaller(self): """Ensures deflating a rect in place keeps its center the same @@ -821,13 +821,13 @@ def test_inflate_ip__smaller(self): r2 = Rect(r) r2.inflate_ip(-4, -6) - self.assertEqual(r.center, r2.center) - self.assertEqual(r.left + 2, r2.left) - self.assertEqual(r.top + 3, r2.top) - self.assertEqual(r.right - 2, r2.right) - self.assertEqual(r.bottom - 3, r2.bottom) - self.assertEqual(r.width - 4, r2.width) - self.assertEqual(r.height - 6, r2.height) + self.assertEqual(r2.center, (5, 8)) + self.assertEqual(r2.left, 4) + self.assertEqual(r2.top, 7) + self.assertEqual(r2.right, 6) + self.assertEqual(r2.bottom, 9) + self.assertEqual(r2.width, 2) + self.assertEqual(r2.height, 2) def test_scale_by__larger_single_argument(self): """The scale method scales around the center of the rectangle"""