1
# Copyright 2010 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
"""Tests of the TimedAction class."""
12
from lp.services.timeline.nestingtimedaction import NestingTimedAction
13
from lp.services.timeline.timeline import Timeline
16
class TestNestingTimedAction(testtools.TestCase):
18
def test_finish_adds_action(self):
20
action = NestingTimedAction("Sending mail", None, timeline)
22
self.assertEqual(1, len(timeline.actions))
23
self.assertEqual(datetime.timedelta(), timeline.actions[-1].duration)
25
def test__init__sets_duration(self):
26
action = NestingTimedAction("Sending mail", None)
27
self.assertEqual(datetime.timedelta(), action.duration)