コード例 #1
0
 def __build_methods(self, method_subsection):
     """Add a bound method to this object for each method defined in the 
     specified method_subsection of METHODS. """
     for method_name in METHODS.get(method_subsection, {}):
         config = METHODS.get(method_subsection, {}).get(method_name)
         method = build_method(**config)
         self.__setattr__(method_name, types.MethodType(method, self, API))
コード例 #2
0
ファイル: tests.py プロジェクト: GunioRobot/pyposterous
 def test_method_creation(self):                
     for app_type in METHODS:
         for method in METHODS.get(app_type):
             self.assertTrue(hasattr(getattr(self.api, method), '__call__'))
コード例 #3
0
 def test_method_creation(self):
     for app_type in METHODS:
         for method in METHODS.get(app_type):
             self.assertTrue(hasattr(getattr(self.api, method), '__call__'))