Closed aaron-sierra closed 4 years ago
In reviewing my work, I noticed that the unit tests that I'd picked for the Lease
and Lease6
classes weren't sensitive to changes in the "now" time, so I moved testing from test_init()
to test_valid()
.
Looks good, thanks for the addition
While debugging a DHCP issue, I found myself needing to review historical
dhcpd.leases
files. It took me a while to realize it, but as time passed the results from my review started to change :frowning_face:I found that this module was checking lease validity against the current system time and that testing used
@freeze_time
decorators.In order to do my work, I modified the module to also support a user-specified reference
datetime
object when initializing classes. I think that it could be useful to others, too.