Ejemplo n.º 1
0
 def test_attr_formatter_chained(self):
     obj = mock.Mock()
     obj.letters = ['a', 'b', 'c']
     letters_formatter = fmt.attr_proxy('letters', len)
     self.assertEqual(3, letters_formatter(obj))
Ejemplo n.º 2
0
 def test_attr_formatter_chained(self):
     obj = mock.Mock()
     obj.letters = ['a', 'b', 'c']
     letters_formatter = fmt.attr_proxy('letters', len)
     self.assertEqual(3, letters_formatter(obj))
Ejemplo n.º 3
0
 def test_attr_formatter_plain(self):
     obj = mock.Mock()
     obj.foo = 'bar'
     foo_formatter = fmt.attr_proxy('foo')
     self.assertEqual('bar', foo_formatter(obj))
Ejemplo n.º 4
0
 def test_attr_formatter_plain(self):
     obj = mock.Mock()
     obj.foo = 'bar'
     foo_formatter = fmt.attr_proxy('foo')
     self.assertEqual('bar', foo_formatter(obj))