示例#1
0
 def test_keyword_args(self):
     assert (represent(self.fb, bar='a',
                       a='bar') == "FooBar(bar='a', a='bar')")
     assert (represent(self.fb, bar=([
         2.1, 'a'
     ], {}, 'foo', set())) == "FooBar(bar=([2.1, 'a'], {}, 'foo', set()))")
     assert (represent(
         'bar', a=2.1, biz=['a'], foo=None,
         b=(4, 'moo')) == "str(a=2.1, biz=['a'], foo=None, b=(4, 'moo'))")
示例#2
0
 def __repr__(self) -> str:
     return represent(self, self.array_count, self.typecode, list(self))
示例#3
0
 def __repr__(self) -> str:
     return represent(self, self.position, self.rotation, self.meshes,
                      self.width, self.height, degrees(self.fov))
示例#4
0
 def __repr__(self) -> str:
     shape_info = (list(self.points), list(self.triangles))
     return represent(self, shape_info, color=tuple(self.color))
示例#5
0
 def __repr__(self) -> str:
     return represent(self, list(self))
示例#6
0
 def __repr__(self):
     cb = self._callback
     return represent(self, self.shortcut, cb.func, *cb.args, **cb.keywords)
示例#7
0
 def test_positional_and_keyword_args(self):
     assert (represent(self.fb, 2.1, a=3,
                       b='bar') == "FooBar(2.1, a=3, b='bar')")
     assert (represent(self.fb, 2, 'bar',
                       bar='v') == "FooBar(2, 'bar', bar='v')")
示例#8
0
 def test_positional_args(self):
     assert (represent(self.fb, 'bar', 3.43,
                       [2, '2', 1]) == "FooBar('bar', 3.43, [2, '2', 1])")
示例#9
0
 def test_no_args(self):
     assert represent(self.fb) == 'FooBar()'