Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 def __repr__(self):
     return "<Delta: {}>".format(short_repr(self.diff, max_length=100))
Exemplo n.º 6
0
    def test_short_repr_when_short(self):

        item = {1: 2}
        output = short_repr(item)
        assert output == '{1: 2}'
Exemplo n.º 7
0
    def test_short_repr_when_long(self):

        item = {'Eat more': 'burritos'}
        output = short_repr(item)
        assert output == "{'Eat more':...}"
Exemplo n.º 8
0
 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)
Exemplo n.º 9
0
    def test_short_repr_when_short(self):

        item = {1: 2}
        output = short_repr(item)
        assert output == '{1: 2}'
Exemplo n.º 10
0
    def test_short_repr_when_long(self):

        item = {'Eat more': 'burritos'}
        output = short_repr(item)
        assert output == "{'Eat more':...}"
Exemplo n.º 11
0
    def test_short_repr_when_long(self):

        item = {'Eat more': 'burritos'}
        output = short_repr(item)
        self.assertEqual(output, "{'Eat more':...}")
Exemplo n.º 12
0
    def test_short_repr_when_short(self):

        item = {1: 2}
        output = short_repr(item)
        self.assertEqual(output, '{1: 2}')