def __repr__(self): if Verbose.level: if self.additional: additional_repr = short_repr(self.additional, max_length=35) result = "<{} {}>".format(self.path(), additional_repr) else: t1_repr = short_repr(self.t1) t2_repr = short_repr(self.t2) result = "<{} t1:{}, t2:{}>".format(self.path(), t1_repr, t2_repr) else: result = "<{}>".format(self.path()) return result
def __repr__(self): name = "<{} parent:{}, child:{}, param:{}>" parent = short_repr(self.parent) child = short_repr(self.child) param = short_repr(self.param) return name.format(self.__class__.__name__, parent, child, param)
def __repr__(self): return "<Delta: {}>".format(short_repr(self.diff, max_length=100))
def test_short_repr_when_short(self): item = {1: 2} output = short_repr(item) assert output == '{1: 2}'
def test_short_repr_when_long(self): item = {'Eat more': 'burritos'} output = short_repr(item) assert output == "{'Eat more':...}"
def __repr__(self): """ Hide the counts since it will be confusing to see them when they are hidden everywhere else. """ return short_repr(self._get_objects_to_hashes_dict(extract_index=0), max_length=500)
def test_short_repr_when_long(self): item = {'Eat more': 'burritos'} output = short_repr(item) self.assertEqual(output, "{'Eat more':...}")
def test_short_repr_when_short(self): item = {1: 2} output = short_repr(item) self.assertEqual(output, '{1: 2}')