def maybe_timestamp(base, attr): if base is not None and getattr(base, attr): return human.format_timestamp_with_milli(getattr(base, attr)) else: return "active"
def test_format_timestamp_with_milli(): assert human.format_timestamp_with_milli(time.time())