Improve FakeTime to be more easily usable
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
- Abel Deuring (community): Approve on 2009-10-23
- Canonical Launchpad Engineering: Pending (code) requested 2009-10-23
-
Diff: 92 lines1 file modifiedlib/lp/testing/__init__.py (+58/-9)
Henning Eggers (henninge) wrote : | #1 |
Changed in launchpad-foundations: | |
status: | New → In Progress |
Fixed in devel r9768 <http://
Changed in launchpad-foundations: | |
status: | In Progress → Fix Committed |
This bug was mentioned in stable r9768 <http://
tags: | added: qa-needstesting |
Ursula Junque (ursinha) wrote : | #4 |
This bug was mentioned in stable r9768 <http://
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
Ah, I just found that lp.testing. time_counter does mostly what is described. Still, the improvement to FakeTime will help. too.