Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Factory:Rebuild
python-fleming
use-assertequal.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File use-assertequal.patch of Package python-fleming
Index: fleming-0.7.0/fleming/tests/fleming_tests.py =================================================================== --- fleming-0.7.0.orig/fleming/tests/fleming_tests.py +++ fleming-0.7.0/fleming/tests/fleming_tests.py @@ -18,7 +18,7 @@ class TestConvertDToDt(unittest.TestCase Tests using a date input. """ dt = fleming.convert_d_to_dt(datetime.date(2013, 3, 3)) - self.assertEquals(dt, datetime.datetime(2013, 3, 3)) + self.assertEqual(dt, datetime.datetime(2013, 3, 3)) class TestAttachTzIfNone(unittest.TestCase): @@ -35,7 +35,7 @@ class TestAttachTzIfNone(unittest.TestCa self.assertIsNone(naive_t.tzinfo) ret = fleming.attach_tz_if_none(naive_t, pytz.utc) # Time should now have a utc tzinfo object - self.assertEquals(ret.tzinfo, pytz.utc) + self.assertEqual(ret.tzinfo, pytz.utc) def test_no_tz_attach_eastern(self): """ @@ -46,7 +46,7 @@ class TestAttachTzIfNone(unittest.TestCa self.assertIsNone(naive_t.tzinfo) ret = fleming.attach_tz_if_none(naive_t, pytz.timezone('US/Eastern')) # Time should now have a utc tzinfo object - self.assertEquals(ret.tzinfo, pytz.timezone('US/Eastern').localize(naive_t).tzinfo) + self.assertEqual(ret.tzinfo, pytz.timezone('US/Eastern').localize(naive_t).tzinfo) def test_existing_tz_attach_utc(self): """ @@ -56,7 +56,7 @@ class TestAttachTzIfNone(unittest.TestCa aware_t = datetime.datetime(2014, 2, 1, tzinfo=pytz.timezone('US/Eastern')) # Try to attach UTC. It should not attach it ret = fleming.attach_tz_if_none(aware_t, pytz.utc) - self.assertEquals(ret.tzinfo, pytz.timezone('US/Eastern')) + self.assertEqual(ret.tzinfo, pytz.timezone('US/Eastern')) class TestRemoveTzIfReturnNaive(unittest.TestCase): @@ -70,7 +70,7 @@ class TestRemoveTzIfReturnNaive(unittest """ naive_t = datetime.datetime(2013, 2, 1, 12) ret = fleming.remove_tz_if_return_naive(naive_t, True) - self.assertEquals(ret, datetime.datetime(2013, 2, 1, 12)) + self.assertEqual(ret, datetime.datetime(2013, 2, 1, 12)) def test_with_naive_dt_false(self): """ @@ -79,7 +79,7 @@ class TestRemoveTzIfReturnNaive(unittest """ naive_t = datetime.datetime(2013, 2, 1, 12) ret = fleming.remove_tz_if_return_naive(naive_t, False) - self.assertEquals(ret, datetime.datetime(2013, 2, 1, 12)) + self.assertEqual(ret, datetime.datetime(2013, 2, 1, 12)) def test_with_aware_dt_true(self): """ @@ -88,7 +88,7 @@ class TestRemoveTzIfReturnNaive(unittest """ aware_t = datetime.datetime(2013, 2, 1, 12, tzinfo=pytz.utc) ret = fleming.remove_tz_if_return_naive(aware_t, True) - self.assertEquals(ret, datetime.datetime(2013, 2, 1, 12)) + self.assertEqual(ret, datetime.datetime(2013, 2, 1, 12)) def test_with_aware_dt_false(self): """ @@ -97,7 +97,7 @@ class TestRemoveTzIfReturnNaive(unittest """ aware_t = datetime.datetime(2013, 2, 1, 12, tzinfo=pytz.utc) ret = fleming.remove_tz_if_return_naive(aware_t, False) - self.assertEquals(ret, datetime.datetime(2013, 2, 1, 12, tzinfo=pytz.utc)) + self.assertEqual(ret, datetime.datetime(2013, 2, 1, 12, tzinfo=pytz.utc)) class TestConvertToTz(unittest.TestCase): @@ -112,7 +112,7 @@ class TestConvertToTz(unittest.TestCase) naive_t = datetime.datetime(2013, 2, 1, 12) ret = fleming.convert_to_tz(naive_t, pytz.timezone('US/Eastern')) # In this time, eastern standard time is 5 hours before UTC - self.assertEquals(ret, pytz.timezone('US/Eastern').localize(datetime.datetime(2013, 2, 1, 7))) + self.assertEqual(ret, pytz.timezone('US/Eastern').localize(datetime.datetime(2013, 2, 1, 7))) def test_aware_utc_to_est_return_aware(self): """ @@ -121,7 +121,7 @@ class TestConvertToTz(unittest.TestCase) aware_t = datetime.datetime(2013, 2, 1, 12, tzinfo=pytz.utc) ret = fleming.convert_to_tz(aware_t, pytz.timezone('US/Eastern')) # In this time, eastern standard time is 5 hours before UTC - self.assertEquals(ret, pytz.timezone('US/Eastern').localize(datetime.datetime(2013, 2, 1, 7))) + self.assertEqual(ret, pytz.timezone('US/Eastern').localize(datetime.datetime(2013, 2, 1, 7))) def test_aware_est_to_cst_return_aware(self): """ @@ -130,7 +130,7 @@ class TestConvertToTz(unittest.TestCase) aware_t = pytz.timezone('US/Eastern').localize(datetime.datetime(2013, 2, 1, 12)) ret = fleming.convert_to_tz(aware_t, pytz.timezone('US/Central')) # Central time zone is one hour behind eastern - self.assertEquals(ret, pytz.timezone('US/Central').localize(datetime.datetime(2013, 2, 1, 11))) + self.assertEqual(ret, pytz.timezone('US/Central').localize(datetime.datetime(2013, 2, 1, 11))) def test_convert_naive_utc_to_est_return_naive(self): """ @@ -140,7 +140,7 @@ class TestConvertToTz(unittest.TestCase) naive_t = datetime.datetime(2013, 2, 1, 12) ret = fleming.convert_to_tz(naive_t, pytz.timezone('US/Eastern'), return_naive=True) # In this time, eastern standard time is 5 hours before UTC - self.assertEquals(ret, datetime.datetime(2013, 2, 1, 7)) + self.assertEqual(ret, datetime.datetime(2013, 2, 1, 7)) def test_aware_utc_to_est_return_naive(self): """ @@ -149,7 +149,7 @@ class TestConvertToTz(unittest.TestCase) aware_t = datetime.datetime(2013, 2, 1, 12, tzinfo=pytz.utc) ret = fleming.convert_to_tz(aware_t, pytz.timezone('US/Eastern'), return_naive=True) # In this time, eastern standard time is 5 hours before UTC - self.assertEquals(ret, datetime.datetime(2013, 2, 1, 7)) + self.assertEqual(ret, datetime.datetime(2013, 2, 1, 7)) def test_aware_est_to_cst_return_naive(self): """ @@ -158,7 +158,7 @@ class TestConvertToTz(unittest.TestCase) aware_t = pytz.timezone('US/Eastern').localize(datetime.datetime(2013, 2, 1, 12)) ret = fleming.convert_to_tz(aware_t, pytz.timezone('US/Central'), return_naive=True) # Central time zone is one hour behind eastern - self.assertEquals(ret, datetime.datetime(2013, 2, 1, 11)) + self.assertEqual(ret, datetime.datetime(2013, 2, 1, 11)) class TestDstNormalize(unittest.TestCase): @@ -174,7 +174,7 @@ class TestDstNormalize(unittest.TestCase """ aware_t = datetime.datetime(2013, 4, 2, tzinfo=pytz.utc) ret = fleming.dst_normalize(aware_t) - self.assertEquals(ret, datetime.datetime(2013, 4, 2, tzinfo=pytz.utc)) + self.assertEqual(ret, datetime.datetime(2013, 4, 2, tzinfo=pytz.utc)) def test_change_in_tz_into_dst(self): """ @@ -185,19 +185,19 @@ class TestDstNormalize(unittest.TestCase est = pytz.timezone('US/Eastern') aware_t = est.localize(datetime.datetime(2013, 3, 7)) # The time zone should not initially be in DST - self.assertEquals(aware_t.tzinfo.dst(aware_t), datetime.timedelta(0)) + self.assertEqual(aware_t.tzinfo.dst(aware_t), datetime.timedelta(0)) # After adding a week to it using a normal timedelta, it should be in dst now aware_t += datetime.timedelta(weeks=1) # However, because of datetime arithmetic, the timezone will not get updated properly - self.assertEquals(aware_t.tzinfo.dst(aware_t), datetime.timedelta(0)) + self.assertEqual(aware_t.tzinfo.dst(aware_t), datetime.timedelta(0)) # Do a DST normalization. The resulting time zone should be in DST, but none of the # time values in original time should have changed ret = fleming.dst_normalize(aware_t) # Verify the time zone of the returned is in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) # Verify that all of the time values are correct (i.e. verify an extra hour wasn't added # because of the DST crossover - self.assertEquals(ret, ret.tzinfo.localize(datetime.datetime(2013, 3, 14))) + self.assertEqual(ret, ret.tzinfo.localize(datetime.datetime(2013, 3, 14))) def test_change_in_tz_out_of_dst(self): """ @@ -208,19 +208,19 @@ class TestDstNormalize(unittest.TestCase est = pytz.timezone('US/Eastern') aware_t = est.localize(datetime.datetime(2013, 11, 1)) # The time zone should initially be in DST - self.assertEquals(aware_t.tzinfo.dst(aware_t), datetime.timedelta(hours=1)) + self.assertEqual(aware_t.tzinfo.dst(aware_t), datetime.timedelta(hours=1)) # After adding a week to it using a normal timedelta, it should not be in dst now aware_t += datetime.timedelta(weeks=1) # However, because of datetime arithmetic, the timezone will not get updated properly - self.assertEquals(aware_t.tzinfo.dst(aware_t), datetime.timedelta(hours=1)) + self.assertEqual(aware_t.tzinfo.dst(aware_t), datetime.timedelta(hours=1)) # Do a DST normalization. The resulting time zone should not be in DST, but none of the # time values in original time should have changed ret = fleming.dst_normalize(aware_t) # Verify the time zone of the returned is not in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) # Verify that all of the time values are correct (i.e. verify an extra hour wasn't added # because of the DST crossover - self.assertEquals(ret, ret.tzinfo.localize(datetime.datetime(2013, 11, 8))) + self.assertEqual(ret, ret.tzinfo.localize(datetime.datetime(2013, 11, 8))) def test_no_change_in_tz(self): """ @@ -231,17 +231,17 @@ class TestDstNormalize(unittest.TestCase aware_t = est.localize(datetime.datetime(2013, 1, 7)) aware_t = est.normalize(aware_t) # The time zone should not initially be in DST - self.assertEquals(aware_t.tzinfo.dst(aware_t), datetime.timedelta(0)) + self.assertEqual(aware_t.tzinfo.dst(aware_t), datetime.timedelta(0)) # After adding a week to it using a normal timedelta, it should still not be in dst aware_t += datetime.timedelta(weeks=1) - self.assertEquals(aware_t.tzinfo.dst(aware_t), datetime.timedelta(0)) + self.assertEqual(aware_t.tzinfo.dst(aware_t), datetime.timedelta(0)) # Do a DST normalization. The resulting time zone should not be in DST, and none of the # time values in original time should have changed ret = fleming.dst_normalize(aware_t) # Verify the time zone of the returned is not in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) # Verify that all of the time values are correct - self.assertEquals(ret, ret.tzinfo.localize(datetime.datetime(2013, 1, 14))) + self.assertEqual(ret, ret.tzinfo.localize(datetime.datetime(2013, 1, 14))) class TestAddTimedelta(unittest.TestCase): @@ -254,7 +254,7 @@ class TestAddTimedelta(unittest.TestCase """ t = datetime.date(2013, 4, 1) ret = fleming.add_timedelta(t, datetime.timedelta(days=2)) - self.assertEquals(ret, datetime.date(2013, 4, 3)) + self.assertEqual(ret, datetime.date(2013, 4, 3)) def test_naive_within_no_tz_return_naive(self): """ @@ -264,7 +264,7 @@ class TestAddTimedelta(unittest.TestCase """ naive_t = datetime.datetime(2013, 4, 1) ret = fleming.add_timedelta(naive_t, datetime.timedelta(days=2)) - self.assertEquals(ret, datetime.datetime(2013, 4, 3)) + self.assertEqual(ret, datetime.datetime(2013, 4, 3)) def test_aware_within_no_tz_return_aware(self): """ @@ -274,7 +274,7 @@ class TestAddTimedelta(unittest.TestCase aware_t = datetime.datetime(2013, 4, 1, tzinfo=pytz.utc) ret = fleming.add_timedelta( aware_t, datetime.timedelta(days=1, minutes=1, seconds=1, microseconds=1)) - self.assertEquals(ret, datetime.datetime(2013, 4, 2, 0, 1, 1, 1, tzinfo=pytz.utc)) + self.assertEqual(ret, datetime.datetime(2013, 4, 2, 0, 1, 1, 1, tzinfo=pytz.utc)) def test_aware_within_no_tz_return_aware_dst_cross(self): """ @@ -284,16 +284,16 @@ class TestAddTimedelta(unittest.TestCase # Create an aware datetime that is not in DST aware_t = fleming.convert_to_tz(datetime.datetime(2013, 3, 1, 5), pytz.timezone('US/Eastern')) # Assert that it isn't in DST - self.assertEquals(aware_t.tzinfo.dst(aware_t), datetime.timedelta(0)) + self.assertEqual(aware_t.tzinfo.dst(aware_t), datetime.timedelta(0)) # Assert the values are midnight for EST - self.assertEquals(aware_t, pytz.timezone('US/Eastern').localize(datetime.datetime(2013, 3, 1))) + self.assertEqual(aware_t, pytz.timezone('US/Eastern').localize(datetime.datetime(2013, 3, 1))) # Add a timedelta across the DST transition (Mar 10) ret = fleming.add_timedelta(aware_t, datetime.timedelta(weeks=2)) # Verify the time zone is now in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) # Verify the time is midnight two weeks later - self.assertEquals(ret, datetime.datetime(2013, 3, 15, tzinfo=ret.tzinfo)) + self.assertEqual(ret, datetime.datetime(2013, 3, 15, tzinfo=ret.tzinfo)) def test_naive_within_tz_return_naive_dst_cross(self): """ @@ -308,7 +308,7 @@ class TestAddTimedelta(unittest.TestCase naive_t, datetime.timedelta(weeks=2), within_tz=pytz.timezone('US/Eastern')) # Verify the time is midnight two weeks later in UTC. Note that the original hour has changed # since we crossed the DST boundary in EST - self.assertEquals(ret, datetime.datetime(2013, 3, 15, 4)) + self.assertEqual(ret, datetime.datetime(2013, 3, 15, 4)) def test_aware_within_tz_return_aware_dst_cross(self): """ @@ -323,7 +323,7 @@ class TestAddTimedelta(unittest.TestCase aware_t, datetime.timedelta(weeks=2), within_tz=pytz.timezone('US/Eastern')) # Verify the time is midnight two weeks later in UTC. Note that the hour changes since it happened # across an EST DST boundary - self.assertEquals(ret, datetime.datetime(2013, 3, 15, 4, tzinfo=pytz.utc)) + self.assertEqual(ret, datetime.datetime(2013, 3, 15, 4, tzinfo=pytz.utc)) def test_aware_est_within_cst_return_aware_dst_cross(self): """ @@ -333,19 +333,19 @@ class TestAddTimedelta(unittest.TestCase # Create an aware datetime that is not in DST aware_t = fleming.convert_to_tz(datetime.datetime(2013, 3, 1, 5), pytz.timezone('US/Eastern')) # Assert that it isn't in DST - self.assertEquals(aware_t.tzinfo.dst(aware_t), datetime.timedelta(0)) + self.assertEqual(aware_t.tzinfo.dst(aware_t), datetime.timedelta(0)) # Assert the values are midnight for EST - self.assertEquals(aware_t, pytz.timezone('US/Eastern').localize(datetime.datetime(2013, 3, 1))) + self.assertEqual(aware_t, pytz.timezone('US/Eastern').localize(datetime.datetime(2013, 3, 1))) # Add a timedelta across the DST transition (Mar 10) within CST ret = fleming.add_timedelta( aware_t, datetime.timedelta(weeks=2), within_tz=pytz.timezone('US/Central')) # Assert that it is in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) # Verify the time is midnight two weeks later in EST. Note that the timezone changes since it happened # across a DST boundary - self.assertEquals(ret, datetime.datetime(2013, 3, 15, tzinfo=ret.tzinfo)) + self.assertEqual(ret, datetime.datetime(2013, 3, 15, tzinfo=ret.tzinfo)) class TestFloor(unittest.TestCase): @@ -362,7 +362,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.date(2013, 4, 3) t = fleming.floor(t, month=1) - self.assertEquals(t, datetime.date(2013, 4, 1)) + self.assertEqual(t, datetime.date(2013, 4, 1)) def test_naive_floor_year(self): """ @@ -370,7 +370,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.floor(t, year=1) - self.assertEquals(t, datetime.datetime(2013, 1, 1)) + self.assertEqual(t, datetime.datetime(2013, 1, 1)) def test_aware_floor_year(self): """ @@ -378,7 +378,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40, tzinfo=pytz.utc) t = fleming.floor(t, year=1) - self.assertEquals(t, datetime.datetime(2013, 1, 1, tzinfo=pytz.utc)) + self.assertEqual(t, datetime.datetime(2013, 1, 1, tzinfo=pytz.utc)) def test_naive_floor_month(self): """ @@ -386,7 +386,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.floor(t, month=1) - self.assertEquals(t, datetime.datetime(2013, 3, 1)) + self.assertEqual(t, datetime.datetime(2013, 3, 1)) def test_naive_floor_week_stays_in_month(self): """ @@ -395,7 +395,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.floor(t, week=1) - self.assertEquals(t, datetime.datetime(2013, 3, 4)) + self.assertEqual(t, datetime.datetime(2013, 3, 4)) def test_naive_floor_week_goes_to_prev_month(self): """ @@ -404,7 +404,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 3, 1, 12, 23, 4, 40) t = fleming.floor(t, week=1) - self.assertEquals(t, datetime.datetime(2013, 2, 25)) + self.assertEqual(t, datetime.datetime(2013, 2, 25)) def test_naive_floor_day(self): """ @@ -412,7 +412,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.floor(t, day=1) - self.assertEquals(t, datetime.datetime(2013, 3, 4)) + self.assertEqual(t, datetime.datetime(2013, 3, 4)) def test_naive_floor_day_return_naive(self): """ @@ -420,7 +420,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.floor(t, day=1) - self.assertEquals(t, datetime.datetime(2013, 3, 4)) + self.assertEqual(t, datetime.datetime(2013, 3, 4)) def test_naive_floor_hour(self): """ @@ -428,7 +428,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.floor(t, hour=1) - self.assertEquals(t, datetime.datetime(2013, 3, 4, 12)) + self.assertEqual(t, datetime.datetime(2013, 3, 4, 12)) def test_naive_floor_minute(self): """ @@ -436,7 +436,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.floor(t, minute=1) - self.assertEquals(t, datetime.datetime(2013, 3, 4, 12, 23)) + self.assertEqual(t, datetime.datetime(2013, 3, 4, 12, 23)) def test_naive_floor_second(self): """ @@ -444,7 +444,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.floor(t, second=1) - self.assertEquals(t, datetime.datetime(2013, 3, 4, 12, 23, 4)) + self.assertEqual(t, datetime.datetime(2013, 3, 4, 12, 23, 4)) def test_aware_floor_month(self): """ @@ -453,11 +453,11 @@ class TestFloor(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.floor(t, month=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 3, 1, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 3, 1, tzinfo=t.tzinfo)) def test_aware_floor_week_stays_in_month(self): """ @@ -467,11 +467,11 @@ class TestFloor(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.floor(t, week=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 3, 4, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 3, 4, tzinfo=t.tzinfo)) def test_aware_floor_week_goes_to_prev_month(self): """ @@ -481,11 +481,11 @@ class TestFloor(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 1, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.floor(t, week=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 2, 25, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 2, 25, tzinfo=t.tzinfo)) def test_aware_floor_day(self): """ @@ -494,11 +494,11 @@ class TestFloor(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.floor(t, day=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 3, 4, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 3, 4, tzinfo=t.tzinfo)) def test_aware_floor_hour(self): """ @@ -507,11 +507,11 @@ class TestFloor(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.floor(t, hour=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 3, 4, t.hour, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 3, 4, t.hour, tzinfo=t.tzinfo)) def test_aware_floor_minute(self): """ @@ -520,11 +520,11 @@ class TestFloor(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.floor(t, minute=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 3, 4, t.hour, 23, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 3, 4, t.hour, 23, tzinfo=t.tzinfo)) def test_aware_floor_second(self): """ @@ -533,11 +533,11 @@ class TestFloor(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.floor(t, second=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 3, 4, t.hour, 23, 4, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 3, 4, t.hour, 23, 4, tzinfo=t.tzinfo)) def test_aware_floor_year_out_of_dst(self): """ @@ -547,11 +547,11 @@ class TestFloor(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 14, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(hours=1)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(hours=1)) ret = fleming.floor(t, year=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 1, 1, tzinfo=ret.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 1, 1, tzinfo=ret.tzinfo)) def test_aware_floor_month_out_of_dst(self): """ @@ -561,11 +561,11 @@ class TestFloor(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 14, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(hours=1)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(hours=1)) ret = fleming.floor(t, month=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 3, 1, tzinfo=ret.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 3, 1, tzinfo=ret.tzinfo)) def test_aware_floor_month_into_dst(self): """ @@ -575,11 +575,11 @@ class TestFloor(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 11, 14, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(hours=0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(hours=0)) ret = fleming.floor(t, month=1) # Resulting time zone should be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) - self.assertEquals(ret, datetime.datetime(2013, 11, 1, tzinfo=ret.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) + self.assertEqual(ret, datetime.datetime(2013, 11, 1, tzinfo=ret.tzinfo)) def test_naive_floor_within_tz_day(self): """ @@ -590,7 +590,7 @@ class TestFloor(unittest.TestCase): ret = fleming.floor(t, day=1, within_tz=pytz.timezone('US/Eastern')) # The return value should be for the last day of the previous month, and the # timezone should still be in UTC - self.assertEquals(ret, datetime.datetime(2013, 3, 31)) + self.assertEqual(ret, datetime.datetime(2013, 3, 31)) def test_naive_floor_within_tz_day_return_naive(self): """ @@ -602,7 +602,7 @@ class TestFloor(unittest.TestCase): ret = fleming.floor(t, day=1, within_tz=pytz.timezone('US/Eastern')) # The return value should be for the last day of the previous month, and the # timezone should still be in UTC - self.assertEquals(ret, datetime.datetime(2013, 3, 31)) + self.assertEqual(ret, datetime.datetime(2013, 3, 31)) def test_est_floor_within_cst_day(self): """ @@ -611,12 +611,12 @@ class TestFloor(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 4, 1, 4), pytz.timezone('US/Eastern')) # Verify it is midnight for eastern time - self.assertEquals(t.hour, 0) + self.assertEqual(t.hour, 0) # Floor the time to a day with respect to CST. Since CST is an hour behind, the day # should be minus one ret = fleming.floor(t, day=1, within_tz=pytz.timezone('US/Central')) - self.assertEquals(ret, datetime.datetime(2013, 3, 31, tzinfo=t.tzinfo)) + self.assertEqual(ret, datetime.datetime(2013, 3, 31, tzinfo=t.tzinfo)) def test_utc_floor_within_est_week(self): """ @@ -626,7 +626,7 @@ class TestFloor(unittest.TestCase): t = datetime.datetime(2013, 4, 8, tzinfo=pytz.utc) ret = fleming.floor(t, week=1, within_tz=pytz.timezone('US/Eastern')) # The time should be a week earlier in UTC - self.assertEquals(ret, datetime.datetime(2013, 4, 1, tzinfo=pytz.utc)) + self.assertEqual(ret, datetime.datetime(2013, 4, 1, tzinfo=pytz.utc)) def test_est_floor_within_utc_week(self): """ @@ -636,11 +636,11 @@ class TestFloor(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 11, 4, 4), pytz.timezone('US/Eastern')) # Affirm that the time is 11 PM in EST - self.assertEquals(t.day, 3) - self.assertEquals(t.hour, 23) + self.assertEqual(t.day, 3) + self.assertEqual(t.hour, 23) ret = fleming.floor(t, week=1, within_tz=pytz.utc) # The time should be a week later in EST since UTC was a week ahead - self.assertEquals(ret, datetime.datetime(2013, 11, 4, tzinfo=t.tzinfo)) + self.assertEqual(ret, datetime.datetime(2013, 11, 4, tzinfo=t.tzinfo)) def test_trimonth_floor(self): """ @@ -649,7 +649,7 @@ class TestFloor(unittest.TestCase): t = datetime.datetime(2013, 5, 2) ret = fleming.floor(t, month=3) # The result should be at the beginning of the second quarter - self.assertEquals(ret, datetime.datetime(2013, 4, 1)) + self.assertEqual(ret, datetime.datetime(2013, 4, 1)) def test_quadday_floor(self): """ @@ -657,7 +657,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 5, 6) ret = fleming.floor(t, day=4) - self.assertEquals(ret, datetime.datetime(2013, 5, 5)) + self.assertEqual(ret, datetime.datetime(2013, 5, 5)) def test_halfday_floor(self): """ @@ -665,7 +665,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 5, 6, 14) ret = fleming.floor(t, hour=12) - self.assertEquals(ret, datetime.datetime(2013, 5, 6, 12)) + self.assertEqual(ret, datetime.datetime(2013, 5, 6, 12)) def test_trimonth_triday_floor(self): """ @@ -673,7 +673,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 1, 8) ret = fleming.floor(t, month=3, day=3) - self.assertEquals(ret, datetime.datetime(2013, 1, 7)) + self.assertEqual(ret, datetime.datetime(2013, 1, 7)) def test_no_floor_naive(self): """ @@ -681,7 +681,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 4, 6, 7, 8) ret = fleming.floor(t) - self.assertEquals(ret, datetime.datetime(2013, 4, 6, 7, 8)) + self.assertEqual(ret, datetime.datetime(2013, 4, 6, 7, 8)) def test_no_floor_aware(self): """ @@ -689,7 +689,7 @@ class TestFloor(unittest.TestCase): """ t = datetime.datetime(2013, 4, 6, 7, 8, tzinfo=pytz.utc) ret = fleming.floor(t) - self.assertEquals(ret, datetime.datetime(2013, 4, 6, 7, 8, tzinfo=pytz.utc)) + self.assertEqual(ret, datetime.datetime(2013, 4, 6, 7, 8, tzinfo=pytz.utc)) def test_invalid_week_value(self): """ @@ -710,7 +710,7 @@ class TestUnixTime(unittest.TestCase): """ t = datetime.date(2013, 4, 1) ret = fleming.unix_time(t) - self.assertEquals(ret, 1364774400) + self.assertEqual(ret, 1364774400) def test_unix_time_epoch(self): """ @@ -718,7 +718,7 @@ class TestUnixTime(unittest.TestCase): """ t = datetime.datetime(1970, 1, 1) ret = fleming.unix_time(t) - self.assertEquals(ret, 0) + self.assertEqual(ret, 0) def test_unix_time_arbitrary_one(self): """ @@ -728,7 +728,7 @@ class TestUnixTime(unittest.TestCase): """ t = datetime.datetime(2013, 4, 1, 2) ret = fleming.unix_time(t) - self.assertEquals(ret, 1364781600) + self.assertEqual(ret, 1364781600) def test_unix_time_arbitrary_two(self): """ @@ -738,7 +738,7 @@ class TestUnixTime(unittest.TestCase): """ t = datetime.datetime(2013, 12, 1, 2) ret = fleming.unix_time(t) - self.assertEquals(ret, 1385863200) + self.assertEqual(ret, 1385863200) def test_unix_time_return_ms(self): """ @@ -747,7 +747,7 @@ class TestUnixTime(unittest.TestCase): """ t = datetime.datetime(2013, 12, 1, 2) ret = fleming.unix_time(t, return_ms=True) - self.assertEquals(ret, 1385863200 * 1000) + self.assertEqual(ret, 1385863200 * 1000) def test_unix_time_aware_arbitrary(self): """ @@ -757,9 +757,9 @@ class TestUnixTime(unittest.TestCase): """ t = fleming.convert_to_tz( datetime.datetime(2013, 12, 1, 7), pytz.timezone('US/Eastern')) - self.assertEquals(t.hour, 2) + self.assertEqual(t.hour, 2) ret = fleming.unix_time(t) - self.assertEquals(ret, 1385881200) + self.assertEqual(ret, 1385881200) def test_unix_time_aware_arbitrary_ms(self): """ @@ -770,9 +770,9 @@ class TestUnixTime(unittest.TestCase): """ t = fleming.convert_to_tz( datetime.datetime(2013, 12, 1, 7), pytz.timezone('US/Eastern')) - self.assertEquals(t.hour, 2) + self.assertEqual(t.hour, 2) ret = fleming.unix_time(t, return_ms=True) - self.assertEquals(ret, 1385881200 * 1000) + self.assertEqual(ret, 1385881200 * 1000) def test_unix_time_naive_within_tz(self): """ @@ -782,12 +782,12 @@ class TestUnixTime(unittest.TestCase): """ t = datetime.datetime(2013, 12, 1, 5) ret = fleming.unix_time(t, within_tz=pytz.timezone('US/Eastern')) - self.assertEquals(ret, 1385856000) + self.assertEqual(ret, 1385856000) # Convert it back to a datetime objects. The values should be for midnight # since it was an EST time t = datetime.datetime.utcfromtimestamp(ret) - self.assertEquals(t.hour, 0) - self.assertEquals(t.day, 1) + self.assertEqual(t.hour, 0) + self.assertEqual(t.day, 1) def test_unix_time_aware_within_tz(self): """ @@ -797,12 +797,12 @@ class TestUnixTime(unittest.TestCase): """ t = datetime.datetime(2013, 12, 1, 5, tzinfo=pytz.utc) ret = fleming.unix_time(t, within_tz=pytz.timezone('US/Eastern')) - self.assertEquals(ret, 1385856000) + self.assertEqual(ret, 1385856000) # Convert it back to a datetime objects. The values should be for midnight # since it was an EST time t = datetime.datetime.utcfromtimestamp(ret) - self.assertEquals(t.hour, 0) - self.assertEquals(t.day, 1) + self.assertEqual(t.hour, 0) + self.assertEqual(t.day, 1) def test_unix_time_aware_within_tz_return_ms(self): """ @@ -812,12 +812,12 @@ class TestUnixTime(unittest.TestCase): """ t = datetime.datetime(2013, 12, 1, 5, tzinfo=pytz.utc) ret = fleming.unix_time(t, within_tz=pytz.timezone('US/Eastern'), return_ms=True) - self.assertEquals(ret, 1385856000 * 1000) + self.assertEqual(ret, 1385856000 * 1000) # Convert it back to a datetime objects. The values should be for midnight # since it was an EST time t = datetime.datetime.utcfromtimestamp(ret / 1000) - self.assertEquals(t.hour, 0) - self.assertEquals(t.day, 1) + self.assertEqual(t.hour, 0) + self.assertEqual(t.day, 1) class TestIntervals(unittest.TestCase): @@ -829,7 +829,7 @@ class TestIntervals(unittest.TestCase): Tests the intervals function using a date as input. """ intervals = fleming.intervals(datetime.date(2013, 3, 1), datetime.timedelta(days=1), count=10) - self.assertEquals( + self.assertEqual( list(intervals), [ datetime.date(2013, 3, 1), datetime.date(2013, 3, 2), datetime.date(2013, 3, 3), datetime.date(2013, 3, 4), @@ -844,7 +844,7 @@ class TestIntervals(unittest.TestCase): """ intervals = fleming.intervals( datetime.date(2013, 3, 1), datetime.timedelta(days=1), stop_dt=datetime.date(2013, 3, 11)) - self.assertEquals( + self.assertEqual( list(intervals), [ datetime.date(2013, 3, 1), datetime.date(2013, 3, 2), datetime.date(2013, 3, 3), datetime.date(2013, 3, 4), @@ -862,7 +862,7 @@ class TestIntervals(unittest.TestCase): intervals = fleming.intervals(datetime.datetime(2013, 1, 1), datetime.timedelta(days=1)) results = [next(intervals) for i in range(10)] - self.assertEquals(results, [ + self.assertEqual(results, [ datetime.datetime(2013, 1, 1), datetime.datetime(2013, 1, 2), datetime.datetime(2013, 1, 3), datetime.datetime(2013, 1, 4), datetime.datetime(2013, 1, 5), datetime.datetime(2013, 1, 6), @@ -876,7 +876,7 @@ class TestIntervals(unittest.TestCase): a count to get the range. Tests when the count is 0 """ intervals = fleming.intervals(datetime.datetime(2013, 3, 1), datetime.timedelta(days=1), count=0) - self.assertEquals(list(intervals), []) + self.assertEqual(list(intervals), []) def test_naive_start_day_td_count_one(self): """ @@ -884,7 +884,7 @@ class TestIntervals(unittest.TestCase): a count to get the range. Tests when the count is 1 """ intervals = fleming.intervals(datetime.datetime(2013, 3, 1), datetime.timedelta(days=1), count=1) - self.assertEquals(list(intervals), [datetime.datetime(2013, 3, 1)]) + self.assertEqual(list(intervals), [datetime.datetime(2013, 3, 1)]) def test_naive_start_day_td_count(self): """ @@ -892,7 +892,7 @@ class TestIntervals(unittest.TestCase): a count to get the range. """ intervals = fleming.intervals(datetime.datetime(2013, 3, 1), datetime.timedelta(days=1), count=10) - self.assertEquals( + self.assertEqual( list(intervals), [ datetime.datetime(2013, 3, 1), datetime.datetime(2013, 3, 2), datetime.datetime(2013, 3, 3), datetime.datetime(2013, 3, 4), @@ -907,7 +907,7 @@ class TestIntervals(unittest.TestCase): a count to get the range. Returns objects as naive times. """ intervals = fleming.intervals(datetime.datetime(2013, 3, 1), datetime.timedelta(days=1), count=10) - self.assertEquals( + self.assertEqual( list(intervals), [ datetime.datetime(2013, 3, 1), datetime.datetime(2013, 3, 2), datetime.datetime(2013, 3, 3), datetime.datetime(2013, 3, 4), @@ -923,7 +923,7 @@ class TestIntervals(unittest.TestCase): """ intervals = fleming.intervals( datetime.datetime(2013, 3, 1, tzinfo=pytz.utc), datetime.timedelta(days=1), count=10) - self.assertEquals( + self.assertEqual( list(intervals), [ datetime.datetime(2013, 3, 1, tzinfo=pytz.utc), datetime.datetime(2013, 3, 2, tzinfo=pytz.utc), datetime.datetime(2013, 3, 3, tzinfo=pytz.utc), datetime.datetime(2013, 3, 4, tzinfo=pytz.utc), @@ -941,7 +941,7 @@ class TestIntervals(unittest.TestCase): est_dst = fleming.convert_to_tz(datetime.datetime(2013, 3, 20), est_no_dst).tzinfo start_dt = fleming.convert_to_tz(datetime.datetime(2013, 3, 5, 5), est_no_dst) intervals = fleming.intervals(start_dt, datetime.timedelta(days=1), count=10) - self.assertEquals( + self.assertEqual( list(intervals), [ est_no_dst.localize(datetime.datetime(2013, 3, 5)), est_no_dst.localize(datetime.datetime(2013, 3, 6)), @@ -962,7 +962,7 @@ class TestIntervals(unittest.TestCase): est = pytz.timezone('US/Eastern') start_dt = fleming.convert_to_tz(datetime.datetime(2013, 2, 5, 5), est) intervals = fleming.intervals(start_dt, datetime.timedelta(days=1, hours=1), count=10) - self.assertEquals( + self.assertEqual( list(intervals), [ est.localize(datetime.datetime(2013, 2, 5)), est.localize(datetime.datetime(2013, 2, 6, 1)), @@ -983,7 +983,7 @@ class TestIntervals(unittest.TestCase): start_dt = datetime.datetime(2013, 3, 5, tzinfo=pytz.utc) intervals = fleming.intervals( start_dt, datetime.timedelta(days=1), count=10, within_tz=pytz.timezone('US/Eastern')) - self.assertEquals( + self.assertEqual( list(intervals), [ datetime.datetime(2013, 3, 5, tzinfo=pytz.utc), datetime.datetime(2013, 3, 6, tzinfo=pytz.utc), datetime.datetime(2013, 3, 7, tzinfo=pytz.utc), datetime.datetime(2013, 3, 8, tzinfo=pytz.utc), @@ -1001,7 +1001,7 @@ class TestIntervals(unittest.TestCase): """ intervals = fleming.intervals( datetime.datetime(2013, 3, 1), datetime.timedelta(days=1), stop_dt=datetime.datetime(2013, 3, 11)) - self.assertEquals( + self.assertEqual( list(intervals), [ datetime.datetime(2013, 3, 1), datetime.datetime(2013, 3, 2), datetime.datetime(2013, 3, 3), datetime.datetime(2013, 3, 4), @@ -1018,7 +1018,7 @@ class TestIntervals(unittest.TestCase): intervals = fleming.intervals( datetime.datetime(2013, 3, 1), datetime.timedelta(days=1), stop_dt=datetime.datetime(2013, 3, 11, tzinfo=pytz.utc)) - self.assertEquals( + self.assertEqual( list(intervals), [ datetime.datetime(2013, 3, 1), datetime.datetime(2013, 3, 2), datetime.datetime(2013, 3, 3), datetime.datetime(2013, 3, 4), @@ -1035,7 +1035,7 @@ class TestIntervals(unittest.TestCase): intervals = fleming.intervals( datetime.datetime(2013, 3, 1, tzinfo=pytz.utc), datetime.timedelta(days=1), stop_dt=datetime.datetime(2013, 3, 11), is_stop_dt_inclusive=True) - self.assertEquals( + self.assertEqual( list(intervals), [ datetime.datetime(2013, 3, 1, tzinfo=pytz.utc), datetime.datetime(2013, 3, 2, tzinfo=pytz.utc), datetime.datetime(2013, 3, 3, tzinfo=pytz.utc), datetime.datetime(2013, 3, 4, tzinfo=pytz.utc), @@ -1054,7 +1054,7 @@ class TestIntervals(unittest.TestCase): datetime.datetime(2013, 3, 1), datetime.timedelta(days=1), stop_dt=fleming.convert_to_tz(datetime.datetime(2013, 3, 11, 4), pytz.timezone('US/Eastern')), is_stop_dt_inclusive=True) - self.assertEquals( + self.assertEqual( list(intervals), [ datetime.datetime(2013, 3, 1), datetime.datetime(2013, 3, 2), datetime.datetime(2013, 3, 3), datetime.datetime(2013, 3, 4), @@ -1075,7 +1075,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.date(2013, 3, 4) t = fleming.ceil(t, month=1) - self.assertEquals(t, datetime.date(2013, 4, 1)) + self.assertEqual(t, datetime.date(2013, 4, 1)) def test_naive_ceil_year(self): """ @@ -1083,7 +1083,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.ceil(t, year=1) - self.assertEquals(t, datetime.datetime(2014, 1, 1)) + self.assertEqual(t, datetime.datetime(2014, 1, 1)) def test_naive_ceil_month(self): """ @@ -1091,7 +1091,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.ceil(t, month=1) - self.assertEquals(t, datetime.datetime(2013, 4, 1)) + self.assertEqual(t, datetime.datetime(2013, 4, 1)) def test_naive_ceil_week_stays_in_month(self): """ @@ -1100,7 +1100,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.ceil(t, week=1) - self.assertEquals(t, datetime.datetime(2013, 3, 11)) + self.assertEqual(t, datetime.datetime(2013, 3, 11)) def test_naive_ceil_week_goes_to_next_month(self): """ @@ -1109,7 +1109,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 3, 31, 12, 23, 4, 40) t = fleming.ceil(t, week=1) - self.assertEquals(t, datetime.datetime(2013, 4, 1)) + self.assertEqual(t, datetime.datetime(2013, 4, 1)) def test_naive_ceil_day(self): """ @@ -1117,7 +1117,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.ceil(t, day=1) - self.assertEquals(t, datetime.datetime(2013, 3, 5)) + self.assertEqual(t, datetime.datetime(2013, 3, 5)) def test_naive_ceil_day_next_month(self): """ @@ -1125,7 +1125,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 2, 28, 12, 23, 4, 40) t = fleming.ceil(t, day=1) - self.assertEquals(t, datetime.datetime(2013, 3, 1)) + self.assertEqual(t, datetime.datetime(2013, 3, 1)) def test_naive_ceil_day_return_naive(self): """ @@ -1133,7 +1133,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.ceil(t, day=1) - self.assertEquals(t, datetime.datetime(2013, 3, 5)) + self.assertEqual(t, datetime.datetime(2013, 3, 5)) def test_naive_ceil_hour(self): """ @@ -1141,7 +1141,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.ceil(t, hour=1) - self.assertEquals(t, datetime.datetime(2013, 3, 4, 13)) + self.assertEqual(t, datetime.datetime(2013, 3, 4, 13)) def test_naive_ceil_minute(self): """ @@ -1149,7 +1149,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.ceil(t, minute=1) - self.assertEquals(t, datetime.datetime(2013, 3, 4, 12, 24)) + self.assertEqual(t, datetime.datetime(2013, 3, 4, 12, 24)) def test_naive_ceil_second(self): """ @@ -1157,7 +1157,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 3, 4, 12, 23, 4, 40) t = fleming.ceil(t, second=1) - self.assertEquals(t, datetime.datetime(2013, 3, 4, 12, 23, 5)) + self.assertEqual(t, datetime.datetime(2013, 3, 4, 12, 23, 5)) def test_aware_ceil_year(self): """ @@ -1166,11 +1166,11 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.ceil(t, year=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2014, 1, 1, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2014, 1, 1, tzinfo=t.tzinfo)) def test_aware_ceil_month(self): """ @@ -1179,11 +1179,11 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.ceil(t, month=1) # Resulting time zone should be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) - self.assertEquals(ret, datetime.datetime(2013, 4, 1, tzinfo=ret.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) + self.assertEqual(ret, datetime.datetime(2013, 4, 1, tzinfo=ret.tzinfo)) def test_aware_ceil_week_stays_in_month(self): """ @@ -1193,11 +1193,11 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.ceil(t, week=1) # Resulting time zone should be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) - self.assertEquals(ret, datetime.datetime(2013, 3, 11, tzinfo=ret.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) + self.assertEqual(ret, datetime.datetime(2013, 3, 11, tzinfo=ret.tzinfo)) def test_aware_ceil_week_goes_to_next_month(self): """ @@ -1207,11 +1207,11 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 31, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(hours=1)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(hours=1)) ret = fleming.ceil(t, week=1) # Resulting time zone should be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) - self.assertEquals(ret, datetime.datetime(2013, 4, 1, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) + self.assertEqual(ret, datetime.datetime(2013, 4, 1, tzinfo=t.tzinfo)) def test_aware_ceil_day(self): """ @@ -1220,11 +1220,11 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.ceil(t, day=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 3, 5, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 3, 5, tzinfo=t.tzinfo)) def test_aware_ceil_day_return_aware(self): """ @@ -1233,9 +1233,9 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.ceil(t, day=1) - self.assertEquals(ret, pytz.timezone('US/Eastern').localize(datetime.datetime(2013, 3, 5))) + self.assertEqual(ret, pytz.timezone('US/Eastern').localize(datetime.datetime(2013, 3, 5))) def test_aware_ceil_hour(self): """ @@ -1244,11 +1244,11 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.ceil(t, hour=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 3, 4, t.hour + 1, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 3, 4, t.hour + 1, tzinfo=t.tzinfo)) def test_aware_ceil_minute(self): """ @@ -1257,11 +1257,11 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.ceil(t, minute=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 3, 4, t.hour, 24, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 3, 4, t.hour, 24, tzinfo=t.tzinfo)) def test_aware_ceil_second(self): """ @@ -1270,11 +1270,11 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 4, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(0)) ret = fleming.ceil(t, second=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 3, 4, t.hour, 23, 5, tzinfo=t.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 3, 4, t.hour, 23, 5, tzinfo=t.tzinfo)) def test_aware_ceil_year_out_of_dst(self): """ @@ -1284,11 +1284,11 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 14, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(hours=1)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(hours=1)) ret = fleming.ceil(t, year=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2014, 1, 1, tzinfo=ret.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2014, 1, 1, tzinfo=ret.tzinfo)) def test_aware_ceil_month_out_of_dst(self): """ @@ -1298,12 +1298,12 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 11, 1, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(hours=1)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(hours=1)) ret = fleming.ceil(t, month=1) # Resulting time zone should not be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(0)) - self.assertEquals(ret, datetime.datetime(2013, 12, 1, tzinfo=ret.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(0)) + self.assertEqual(ret, datetime.datetime(2013, 12, 1, tzinfo=ret.tzinfo)) def test_aware_ceil_month_into_dst(self): """ @@ -1313,11 +1313,11 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 3, 1, 12, 23, 4, 40), pytz.timezone('US/Eastern')) # Original time zone should not be in DST - self.assertEquals(t.tzinfo.dst(t), datetime.timedelta(hours=0)) + self.assertEqual(t.tzinfo.dst(t), datetime.timedelta(hours=0)) ret = fleming.ceil(t, month=1) # Resulting time zone should be in DST - self.assertEquals(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) - self.assertEquals(ret, datetime.datetime(2013, 4, 1, tzinfo=ret.tzinfo)) + self.assertEqual(ret.tzinfo.dst(ret), datetime.timedelta(hours=1)) + self.assertEqual(ret, datetime.datetime(2013, 4, 1, tzinfo=ret.tzinfo)) def test_naive_ceil_within_tz_day(self): """ @@ -1327,7 +1327,7 @@ class TestCeil(unittest.TestCase): # t is the first in UTC, but it is the next day in Germany. ret = fleming.ceil(t, day=1, within_tz=pytz.timezone('Europe/Berlin')) # The return value should be for April 3, and the timezone should still be in UTC - self.assertEquals(ret, datetime.datetime(2013, 4, 3)) + self.assertEqual(ret, datetime.datetime(2013, 4, 3)) def test_naive_ceil_within_est_no_diff(self): """ @@ -1337,7 +1337,7 @@ class TestCeil(unittest.TestCase): t = datetime.datetime(2013, 3, 2) ret = fleming.ceil(t, month=1, within_tz=pytz.timezone('US/Eastern')) # The return value should be the start of the next month - self.assertEquals(ret, datetime.datetime(2013, 4, 1)) + self.assertEqual(ret, datetime.datetime(2013, 4, 1)) def test_naive_ceil_within_est_diff(self): """ @@ -1347,7 +1347,7 @@ class TestCeil(unittest.TestCase): t = datetime.datetime(2013, 3, 1) ret = fleming.ceil(t, month=1, within_tz=pytz.timezone('US/Eastern')) # The return value should be the start of March since it was still Feb in EST - self.assertEquals(ret, datetime.datetime(2013, 3, 1)) + self.assertEqual(ret, datetime.datetime(2013, 3, 1)) def test_cst_ceil_within_est_day(self): """ @@ -1356,12 +1356,12 @@ class TestCeil(unittest.TestCase): t = fleming.convert_to_tz( datetime.datetime(2013, 4, 1, 4, 2), pytz.timezone('US/Central')) # Verify it is 11pm for central time - self.assertEquals(t.hour, 23) + self.assertEqual(t.hour, 23) # Floor the time to a day with respect to EST. Since EST is an hour ahead, the day # should be plus two of the original day (March 31) ret = fleming.ceil(t, day=1, within_tz=pytz.timezone('US/Eastern')) - self.assertEquals(ret, datetime.datetime(2013, 4, 2, tzinfo=t.tzinfo)) + self.assertEqual(ret, datetime.datetime(2013, 4, 2, tzinfo=t.tzinfo)) def test_utc_ceil_within_berlin_week(self): """ @@ -1371,7 +1371,7 @@ class TestCeil(unittest.TestCase): t = datetime.datetime(2013, 4, 14, 23, tzinfo=pytz.utc) ret = fleming.ceil(t, week=1, within_tz=pytz.timezone('Europe/Berlin')) # The time should be a week later in UTC - self.assertEquals(ret, datetime.datetime(2013, 4, 22, tzinfo=pytz.utc)) + self.assertEqual(ret, datetime.datetime(2013, 4, 22, tzinfo=pytz.utc)) def test_trimonth_ceil(self): """ @@ -1380,7 +1380,7 @@ class TestCeil(unittest.TestCase): t = datetime.datetime(2013, 11, 2) ret = fleming.ceil(t, month=3) # The result should be at the beginning of the next quarter - self.assertEquals(ret, datetime.datetime(2014, 1, 1)) + self.assertEqual(ret, datetime.datetime(2014, 1, 1)) def test_quadday_ceil(self): """ @@ -1388,7 +1388,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 5, 6) ret = fleming.ceil(t, day=4) - self.assertEquals(ret, datetime.datetime(2013, 5, 9)) + self.assertEqual(ret, datetime.datetime(2013, 5, 9)) def test_halfday_ceil(self): """ @@ -1396,7 +1396,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 5, 6, 11) ret = fleming.ceil(t, hour=12) - self.assertEquals(ret, datetime.datetime(2013, 5, 6, 12)) + self.assertEqual(ret, datetime.datetime(2013, 5, 6, 12)) def test_trimonth_triday_ceil(self): """ @@ -1404,7 +1404,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 1, 8) ret = fleming.ceil(t, month=3, day=3) - self.assertEquals(ret, datetime.datetime(2013, 4, 1)) + self.assertEqual(ret, datetime.datetime(2013, 4, 1)) def test_no_ceil(self): """ @@ -1412,7 +1412,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 4, 6, 7, 8) ret = fleming.ceil(t) - self.assertEquals(ret, datetime.datetime(2013, 4, 6, 7, 8)) + self.assertEqual(ret, datetime.datetime(2013, 4, 6, 7, 8)) def test_aware_no_ceil(self): """ @@ -1421,7 +1421,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 4, 6, 7, 8, tzinfo=pytz.utc) ret = fleming.ceil(t) - self.assertEquals(ret, datetime.datetime(2013, 4, 6, 7, 8, tzinfo=pytz.utc)) + self.assertEqual(ret, datetime.datetime(2013, 4, 6, 7, 8, tzinfo=pytz.utc)) def test_invalid_week_value(self): """ @@ -1437,7 +1437,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 1, 1) ret = fleming.ceil(t, year=1) - self.assertEquals(ret, datetime.datetime(2013, 1, 1)) + self.assertEqual(ret, datetime.datetime(2013, 1, 1)) def test_ceil_month_on_boundary(self): """ @@ -1445,18 +1445,18 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 5, 1) ret = fleming.ceil(t, month=1) - self.assertEquals(ret, datetime.datetime(2013, 5, 1)) + self.assertEqual(ret, datetime.datetime(2013, 5, 1)) def test_ceil_aware_month_on_boundary(self): """ Tests ceil of an aware month that is already on the boundary in its timezone. Should return the original time. """ t = fleming.convert_to_tz(datetime.datetime(2013, 5, 1, 4, tzinfo=pytz.utc), pytz.timezone('US/Eastern')) - self.assertEquals(t.day, 1) - self.assertEquals(t.hour, 0) - self.assertEquals(t.month, 5) + self.assertEqual(t.day, 1) + self.assertEqual(t.hour, 0) + self.assertEqual(t.month, 5) ret = fleming.ceil(t, month=1) - self.assertEquals(ret, datetime.datetime(2013, 5, 1, tzinfo=t.tzinfo)) + self.assertEqual(ret, datetime.datetime(2013, 5, 1, tzinfo=t.tzinfo)) def test_ceil_naive_within_tz_on_boundary(self): """ @@ -1465,7 +1465,7 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 5, 1, 4) ret = fleming.ceil(t, month=1, within_tz=pytz.timezone('US/Eastern')) - self.assertEquals(ret, datetime.datetime(2013, 5, 1)) + self.assertEqual(ret, datetime.datetime(2013, 5, 1)) def test_ceil_one_microsecond_above_interval(self): """ @@ -1473,4 +1473,4 @@ class TestCeil(unittest.TestCase): """ t = datetime.datetime(2013, 5, 1, 0, 0, 0, 1) ret = fleming.ceil(t, month=1) - self.assertEquals(ret, datetime.datetime(2013, 6, 1)) + self.assertEqual(ret, datetime.datetime(2013, 6, 1))
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor