Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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):
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):
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):
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):
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)