Example #1
0
def maybe_timestamp(base, attr):
    if base is not None and getattr(base, attr):
        return human.format_timestamp_with_milli(getattr(base, attr))
    else:
        # in mitmdump we serialize before a connection is closed.
        # loading those flows at a later point shouldn't display "active".
        # We also use a ndash (and not a regular dash) so that it is sorted
        # after other timestamps. We may need to revisit that in the future if it turns out
        # to render ugly in consoles.
        return "–"
Example #2
0
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"
Example #3
0
def test_format_timestamp_with_milli():
    assert human.format_timestamp_with_milli(time.time())
Example #4
0
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"
Example #5
0
def test_format_timestamp_with_milli():
    assert human.format_timestamp_with_milli(time.time())