From 9a98794a734f69eef2785e853563d1ee19594ca4 Mon Sep 17 00:00:00 2001 From: Denys Zhdanov Date: Sun, 25 Aug 2024 20:32:36 +0200 Subject: [PATCH] fix attime tests for python 3.12 --- webapp/tests/test_attime.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/webapp/tests/test_attime.py b/webapp/tests/test_attime.py index 25b616a22..9784df7f6 100644 --- a/webapp/tests/test_attime.py +++ b/webapp/tests/test_attime.py @@ -102,12 +102,12 @@ def test_should_handle_dst_boundary(self): def test_parse_naive_datetime(self): time_ref = parseATTime(datetime(self.MOCK_DATE.year, self.MOCK_DATE.month, self.MOCK_DATE.day, 8, 50), self.specified_tz) expected = self.specified_tz.localize(datetime(self.MOCK_DATE.year, self.MOCK_DATE.month, self.MOCK_DATE.day, 8, 50)) - self.assertEquals(time_ref, expected) + self.assertEqual(time_ref, expected) def test_parse_zone_aware_datetime(self): time_ref = parseATTime(self.specified_tz.localize(datetime(self.MOCK_DATE.year, self.MOCK_DATE.month, self.MOCK_DATE.day, 8, 50)), self.specified_tz) expected = self.specified_tz.localize(datetime(self.MOCK_DATE.year, self.MOCK_DATE.month, self.MOCK_DATE.day, 8, 50)) - self.assertEquals(time_ref, expected) + self.assertEqual(time_ref, expected) @mock.patch('graphite.render.attime.datetime', mockDateTime(2015, 1, 1, 11, 0, 0)) @@ -118,11 +118,11 @@ class parseTimeReferenceTest(TestCase): def test_parse_empty_return_now(self): time_ref = parseTimeReference('') - self.assertEquals(time_ref, self.MOCK_DATE) + self.assertEqual(time_ref, self.MOCK_DATE) def test_parse_None_return_now(self): time_ref = parseTimeReference(None) - self.assertEquals(time_ref, self.MOCK_DATE) + self.assertEqual(time_ref, self.MOCK_DATE) def test_parse_random_string_raise_Exception(self): with self.assertRaises(Exception): @@ -130,7 +130,7 @@ def test_parse_random_string_raise_Exception(self): def test_parse_now_return_now(self): time_ref = parseTimeReference("now") - self.assertEquals(time_ref, self.MOCK_DATE) + self.assertEqual(time_ref, self.MOCK_DATE) def test_parse_colon_raises_ValueError(self): with self.assertRaises(ValueError): @@ -139,32 +139,32 @@ def test_parse_colon_raises_ValueError(self): def test_parse_naive_datetime(self): time_ref = parseTimeReference(datetime(self.MOCK_DATE.year, self.MOCK_DATE.month, self.MOCK_DATE.day, 8, 50)) expected = self.zone.localize(datetime(self.MOCK_DATE.year, self.MOCK_DATE.month, self.MOCK_DATE.day, 8, 50)) - self.assertEquals(time_ref, expected) + self.assertEqual(time_ref, expected) def test_parse_zone_aware_datetime(self): time_ref = parseTimeReference(self.zone.localize(datetime(self.MOCK_DATE.year, self.MOCK_DATE.month, self.MOCK_DATE.day, 8, 50))) expected = self.zone.localize(datetime(self.MOCK_DATE.year, self.MOCK_DATE.month, self.MOCK_DATE.day, 8, 50)) - self.assertEquals(time_ref, expected) + self.assertEqual(time_ref, expected) def test_parse_hour_return_hour_of_today(self): time_ref = parseTimeReference("8:50") expected = self.zone.localize(datetime(self.MOCK_DATE.year, self.MOCK_DATE.month, self.MOCK_DATE.day, 8, 50)) - self.assertEquals(time_ref, expected) + self.assertEqual(time_ref, expected) def test_parse_hour_am(self): time_ref = parseTimeReference("8:50am") expected = self.zone.localize(datetime(self.MOCK_DATE.year, self.MOCK_DATE.month, self.MOCK_DATE.day, 8, 50)) - self.assertEquals(time_ref, expected) + self.assertEqual(time_ref, expected) def test_parse_hour_pm(self): time_ref = parseTimeReference("8:50pm") expected = self.zone.localize(datetime(self.MOCK_DATE.year, self.MOCK_DATE.month, self.MOCK_DATE.day, 20, 50)) - self.assertEquals(time_ref, expected) + self.assertEqual(time_ref, expected) def test_parse_hour_only_am(self): time_ref = parseTimeReference("8am") expected = self.zone.localize(datetime(self.MOCK_DATE.year, self.MOCK_DATE.month, self.MOCK_DATE.day, 8, 0)) - self.assertEquals(time_ref, expected) + self.assertEqual(time_ref, expected) def test_parse_hour_only_pm(self): time_ref = parseTimeReference("10pm")