columns: Useful __str__, __repr__ implementation
The default implementations for __str__ and __repr__ are rubbish.
>>> from osc_lib.cli import format_columns
>>> str(format_columns.DictColumn({'foo': 'bar'}))
'<osc_lib.cli.format_columns.DictColumn object at 0x7f6e26771e40>'
>>> repr(format_columns.DictColumn({'foo': 'bar'}))
'<osc_lib.cli.format_columns.DictColumn object at 0x7f6e26b57ac0>'
Make it useful.
>>> from osc_lib.cli import format_columns
>>> str(format_columns.DictColumn({'foo': 'bar'}))
"foo='bar'"
>>> repr(format_columns.DictColumn({'foo': 'bar'}))
"DictColumn({'foo': 'bar'})"
This helps when testing as the reason for mismatches will be more
obvious.
Change-Id: I8b8598875f896cb3dbf417515d377e7758b3b98b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Loading
Please register or sign in to comment