Commit d9eb2b26 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Revert "testAlarm: commit transaction after alarm.setNextAlarmDate()."

This reverts commit e83a42ba.
parent bc14f4e7
...@@ -79,7 +79,6 @@ class TestAlarm(AlarmTestCase): ...@@ -79,7 +79,6 @@ class TestAlarm(AlarmTestCase):
alarm.setEnabled(True) alarm.setEnabled(True)
self.assertEqual(alarm.getAlarmDate(), date) self.assertEqual(alarm.getAlarmDate(), date)
alarm.setNextAlarmDate(current_date=now) # This should not do change the alarm date alarm.setNextAlarmDate(current_date=now) # This should not do change the alarm date
self.commit()
self.assertEqual(alarm.getAlarmDate(),date) self.assertEqual(alarm.getAlarmDate(),date)
def test_14_NewActiveProcess(self): def test_14_NewActiveProcess(self):
...@@ -385,7 +384,6 @@ class TestPeriodicity(AlarmTestCase): ...@@ -385,7 +384,6 @@ class TestPeriodicity(AlarmTestCase):
for date in args[:-1]: for date in args[:-1]:
self.assertEqual(alarm.getAlarmDate(),date) self.assertEqual(alarm.getAlarmDate(),date)
alarm.setNextAlarmDate(current_date=date) alarm.setNextAlarmDate(current_date=date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),args[-1]) self.assertEqual(alarm.getAlarmDate(),args[-1])
def test_03_EveryHour(self): def test_03_EveryHour(self):
...@@ -396,16 +394,13 @@ class TestPeriodicity(AlarmTestCase): ...@@ -396,16 +394,13 @@ class TestPeriodicity(AlarmTestCase):
alarm.setPeriodicityHourFrequency(1) alarm.setPeriodicityHourFrequency(1)
self.tic() self.tic()
alarm.setNextAlarmDate(current_date=now) alarm.setNextAlarmDate(current_date=now)
self.commit()
self.assertEqual(alarm.getAlarmDate(), date) self.assertEqual(alarm.getAlarmDate(), date)
now = addToDate(now,day=2) now = addToDate(now,day=2)
alarm.setNextAlarmDate(current_date=now) alarm.setNextAlarmDate(current_date=now)
self.commit()
next_date = addToDate(date,hour=1) next_date = addToDate(date,hour=1)
self.assertEqual(alarm.getAlarmDate(),next_date) self.assertEqual(alarm.getAlarmDate(),next_date)
now = addToDate(now,hour=1,minute=5) now = addToDate(now,hour=1,minute=5)
alarm.setNextAlarmDate(current_date=now) alarm.setNextAlarmDate(current_date=now)
self.commit()
next_date = addToDate(next_date,hour=1) next_date = addToDate(next_date,hour=1)
self.assertEqual(alarm.getAlarmDate(),next_date) self.assertEqual(alarm.getAlarmDate(),next_date)
# check if manual invoking does not break getAlarmDate() result. # check if manual invoking does not break getAlarmDate() result.
...@@ -422,16 +417,13 @@ class TestPeriodicity(AlarmTestCase): ...@@ -422,16 +417,13 @@ class TestPeriodicity(AlarmTestCase):
alarm.setPeriodicityHourFrequency(3) alarm.setPeriodicityHourFrequency(3)
self.tic() self.tic()
alarm.setNextAlarmDate(current_date=now) alarm.setNextAlarmDate(current_date=now)
self.commit()
self.assertEqual(alarm.getAlarmDate(),date) self.assertEqual(alarm.getAlarmDate(),date)
now = addToDate(now,day=2) now = addToDate(now,day=2)
alarm.setNextAlarmDate(current_date=now) alarm.setNextAlarmDate(current_date=now)
self.commit()
next_date = addToDate(date,hour=3) next_date = addToDate(date,hour=3)
self.assertEqual(alarm.getAlarmDate(),next_date) self.assertEqual(alarm.getAlarmDate(),next_date)
now = addToDate(now,hour=3,minute=7,second=4) now = addToDate(now,hour=3,minute=7,second=4)
alarm.setNextAlarmDate(current_date=now) alarm.setNextAlarmDate(current_date=now)
self.commit()
next_date = addToDate(next_date,hour=3) next_date = addToDate(next_date,hour=3)
self.assertEqual(alarm.getAlarmDate(),next_date) self.assertEqual(alarm.getAlarmDate(),next_date)
...@@ -448,13 +440,10 @@ class TestPeriodicity(AlarmTestCase): ...@@ -448,13 +440,10 @@ class TestPeriodicity(AlarmTestCase):
self.tic() self.tic()
self.assertEqual(alarm.getAlarmDate(),right_first_date) self.assertEqual(alarm.getAlarmDate(),right_first_date)
alarm.setNextAlarmDate(current_date=right_first_date) alarm.setNextAlarmDate(current_date=right_first_date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),right_second_date) self.assertEqual(alarm.getAlarmDate(),right_second_date)
alarm.setNextAlarmDate(current_date=right_second_date) alarm.setNextAlarmDate(current_date=right_second_date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),right_third_date) self.assertEqual(alarm.getAlarmDate(),right_third_date)
alarm.setNextAlarmDate(current_date=right_third_date) alarm.setNextAlarmDate(current_date=right_third_date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),right_fourth_date) self.assertEqual(alarm.getAlarmDate(),right_fourth_date)
def test_06_EveryDayOnce(self): def test_06_EveryDayOnce(self):
...@@ -469,10 +458,8 @@ class TestPeriodicity(AlarmTestCase): ...@@ -469,10 +458,8 @@ class TestPeriodicity(AlarmTestCase):
self.tic() self.tic()
self.assertEqual(alarm.getAlarmDate(),right_first_date) self.assertEqual(alarm.getAlarmDate(),right_first_date)
alarm.setNextAlarmDate(current_date=right_first_date) alarm.setNextAlarmDate(current_date=right_first_date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),right_second_date) self.assertEqual(alarm.getAlarmDate(),right_second_date)
alarm.setNextAlarmDate(current_date=right_second_date) alarm.setNextAlarmDate(current_date=right_second_date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),right_third_date) self.assertEqual(alarm.getAlarmDate(),right_third_date)
def test_07_Every3DaysSomeHours(self): def test_07_Every3DaysSomeHours(self):
...@@ -488,13 +475,10 @@ class TestPeriodicity(AlarmTestCase): ...@@ -488,13 +475,10 @@ class TestPeriodicity(AlarmTestCase):
self.tic() self.tic()
self.assertEqual(alarm.getAlarmDate(),right_first_date) self.assertEqual(alarm.getAlarmDate(),right_first_date)
alarm.setNextAlarmDate(current_date=right_first_date) alarm.setNextAlarmDate(current_date=right_first_date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),right_second_date) self.assertEqual(alarm.getAlarmDate(),right_second_date)
alarm.setNextAlarmDate(current_date=right_second_date) alarm.setNextAlarmDate(current_date=right_second_date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),right_third_date) self.assertEqual(alarm.getAlarmDate(),right_third_date)
alarm.setNextAlarmDate(current_date=right_third_date) alarm.setNextAlarmDate(current_date=right_third_date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),right_fourth_date) self.assertEqual(alarm.getAlarmDate(),right_fourth_date)
def test_07a_Every4DaysSomeHours(self): def test_07a_Every4DaysSomeHours(self):
...@@ -511,16 +495,12 @@ class TestPeriodicity(AlarmTestCase): ...@@ -511,16 +495,12 @@ class TestPeriodicity(AlarmTestCase):
self.tic() self.tic()
self.assertEqual(alarm.getAlarmDate(),right_first_date) self.assertEqual(alarm.getAlarmDate(),right_first_date)
alarm.setNextAlarmDate(current_date=right_first_date) alarm.setNextAlarmDate(current_date=right_first_date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),right_second_date) self.assertEqual(alarm.getAlarmDate(),right_second_date)
alarm.setNextAlarmDate(current_date=right_second_date) alarm.setNextAlarmDate(current_date=right_second_date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),right_third_date) self.assertEqual(alarm.getAlarmDate(),right_third_date)
alarm.setNextAlarmDate(current_date=right_third_date) alarm.setNextAlarmDate(current_date=right_third_date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),right_fourth_date) self.assertEqual(alarm.getAlarmDate(),right_fourth_date)
alarm.setNextAlarmDate(current_date=right_fourth_date) alarm.setNextAlarmDate(current_date=right_fourth_date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),right_fifth_date) self.assertEqual(alarm.getAlarmDate(),right_fifth_date)
def test_08_SomeWeekDaysSomeHours(self): def test_08_SomeWeekDaysSomeHours(self):
...@@ -594,16 +574,13 @@ class TestPeriodicity(AlarmTestCase): ...@@ -594,16 +574,13 @@ class TestPeriodicity(AlarmTestCase):
alarm.setPeriodicityMinuteFrequency(5) alarm.setPeriodicityMinuteFrequency(5)
self.tic() self.tic()
alarm.setNextAlarmDate(current_date=now) alarm.setNextAlarmDate(current_date=now)
self.commit()
self.assertEqual(alarm.getAlarmDate(),date) self.assertEqual(alarm.getAlarmDate(),date)
now = addToDate(now,day=2) now = addToDate(now,day=2)
alarm.setNextAlarmDate(current_date=now) alarm.setNextAlarmDate(current_date=now)
self.commit()
next_date = addToDate(date,minute=5) next_date = addToDate(date,minute=5)
self.assertEqual(alarm.getAlarmDate(),next_date) self.assertEqual(alarm.getAlarmDate(),next_date)
now = addToDate(now,minute=5,second=14) now = addToDate(now,minute=5,second=14)
alarm.setNextAlarmDate(current_date=now) alarm.setNextAlarmDate(current_date=now)
self.commit()
next_date = addToDate(next_date,minute=5) next_date = addToDate(next_date,minute=5)
self.assertEqual(alarm.getAlarmDate(),next_date) self.assertEqual(alarm.getAlarmDate(),next_date)
...@@ -615,7 +592,6 @@ class TestPeriodicity(AlarmTestCase): ...@@ -615,7 +592,6 @@ class TestPeriodicity(AlarmTestCase):
alarm.setPeriodicityMinuteFrequency(1) alarm.setPeriodicityMinuteFrequency(1)
self.tic() self.tic()
alarm.setNextAlarmDate(current_date=date) alarm.setNextAlarmDate(current_date=date)
self.commit()
self.assertEqual(alarm.getAlarmDate(),date) self.assertEqual(alarm.getAlarmDate(),date)
def test_week_day_item_list(self): def test_week_day_item_list(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment