def test_get_html(): assert get_html('astring') == 'astring' assert get_html(1.2) == '1.2' assert get_html(100) == '100' # Complex object without __str__ implementation, expect repr-like assert get_html(AclTrace()) == 'AclTrace(events=[])'
def _repr_html_(self): # type: () -> str result = "<br><br>".join([get_html(element) for element in self]) # type: str return result
def test_get_html(): assert get_html("astring") == "astring" assert get_html(1.2) == "1.2" assert get_html(100) == "100" # Complex object without __str__ implementation, expect repr-like assert get_html(AclTrace()) == "AclTrace(events=[])"