Exemplo n.º 1
0
 def test_prefix(self):
     """
     If a prefix is given, L{accumulateMethods} limits its results to
     methods beginning with that prefix.  Keys in the resulting dictionary
     also have the prefix removed from them.
     """
     x = Separate()
     output = {}
     accumulateMethods(x, output, 'good_')
     self.assertEqual({'method': x.good_method}, output)
Exemplo n.º 2
0
 def test_ownClass(self):
     """
     If x is and instance of Base and Base defines a method named method,
     L{accumulateMethods} adds an item to the given dictionary with
     C{"method"} as the key and a bound method object for Base.method value.
     """
     x = Base()
     output = {}
     accumulateMethods(x, output)
     self.assertEqual({"method": x.method}, output)
Exemplo n.º 3
0
 def test_prefix(self):
     """
     If a prefix is given, L{accumulateMethods} limits its results to
     methods beginning with that prefix.  Keys in the resulting dictionary
     also have the prefix removed from them.
     """
     x = Separate()
     output = {}
     accumulateMethods(x, output, 'good_')
     self.assertEqual({'method': x.good_method}, output)
Exemplo n.º 4
0
 def test_ownClass(self):
     """
     If x is and instance of Base and Base defines a method named method,
     L{accumulateMethods} adds an item to the given dictionary with
     C{"method"} as the key and a bound method object for Base.method value.
     """
     x = Base()
     output = {}
     accumulateMethods(x, output)
     self.assertEqual({"method": x.method}, output)
Exemplo n.º 5
0
 def _getAsserts(self):
     dct = {}
     accumulateMethods(self, dct, 'assert')
     return [ dct[k] for k in dct if not k.startswith('Not') and k != '_' ]
Exemplo n.º 6
0
 def _getAsserts(self):
     dct = {}
     accumulateMethods(self, dct, 'assert')
     return [dct[k] for k in dct if not k.startswith('Not') and k != '_']
Exemplo n.º 7
0
 def _getAsserts(self):
     dct = {}
     accumulateMethods(self, dct, "assert")
     return [dct[k] for k in dct if not k.startswith("Not") and k != "_"]