Improve FakeTime to be more easily usable
Bug #458924 reported by
Henning Eggers
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
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
lp:~henninge/launchpad/bug-458924
Merged
into
lp:launchpad
- Abel Deuring (community): Approve
- Canonical Launchpad Engineering: Pending (code) requested
-
Diff: 92 lines1 file modifiedlib/lp/testing/__init__.py (+58/-9)
Changed in launchpad-foundations: | |
status: | New → In Progress |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad-foundations: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Ah, I just found that lp.testing. time_counter does mostly what is described. Still, the improvement to FakeTime will help. too.