Improve FakeTime to be more easily usable

Bug #458924 reported by Henning Eggers on 2009-10-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Low
Henning Eggers

Bug Description

The lp.testing.FakeTime class requires to explicitly give a start value and an increment for the advance method. To a test these values are most likely arbritary as long as the time is sure to be advancing.

The methods of FakeTime should provide default vaules. The actual current time can be used as a starting value and advances can be in milliseconds. Also, the advancement could be configured during init.

In addition, a nice "next_now" method should be provided to combine "now" and "advance" to produce a new, adavancing time value on each call.

Related branches

Henning Eggers (henninge) wrote :

Ah, I just found that lp.testing.time_counter does mostly what is described. Still, the improvement to FakeTime will help. too.

Changed in launchpad-foundations:
status: New → In Progress
Changed in launchpad-foundations:
status: In Progress → Fix Committed
tags: added: qa-needstesting
tags: added: qa-ok
removed: qa-needstesting
Changed in launchpad-foundations:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers