You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logged times are system-dependent. It's possible to mock these times.
The function fulfills several purposes: some logical checks, creating the statistical strings, and writing to some designated output. Unit-testing a function with so many effects is tedious and a bit of an anti-pattern. Maybe the log_data function should be broken up into a few more modular functions that are then easier to test.
Update: since make_output_string has been extracted from log_data and tested reasonably thoroughly, the only testable features remaining for log_data are the call_freq and call_times assignments. But these variable assignments don't seem as if they need to be tested (the logic is unambiguous).
Activity
Datamine commentedon Feb 19, 2017
Update: since
make_output_stringhas been extracted fromlog_dataand tested reasonably thoroughly, the only testable features remaining forlog_dataare thecall_freqandcall_timesassignments. But these variable assignments don't seem as if they need to be tested (the logic is unambiguous).