Commits

Tetsuya Morimoto committed 0bcdecf

renamed assert_methods to assert_response for more proper name

Comments (0)

Files changed (1)

src/rtm/tests/test_rtm_object.py

 from os.path import dirname, join as pathjoin, realpath
 from nose.plugins.skip import SkipTest
 from nose.tools import *
-from StringIO import StringIO
 
 import rtm.rtm as RTM
 
+# constant for test
 KEY_TXT = pathjoin(dirname(realpath(__file__)), 'apikey.txt')
 KEY_TXT_FORMAT = """
 The format are(ConfigParser readable):
     def assert_stat_ok(self, rsp):
         assert_equal(u"ok", rsp.stat)
 
-    def assert_methods(self, func, elem=None, **params):
-        """high-level assertion for stat/attr of api methods"""
+    def assert_response(self, func, elem=None, **params):
+        """assert the stat/attr(only top) of response from api"""
         api, method = func.func_name.replace('test_', '').split('_')
         elem = elem or api
         api_method = "%s.%s" % (api, method)
 
     def test_auth_checkToken(self):
         params = {'auth_token': self.token}
-        self.assert_methods(self.test_auth_checkToken, **params)
+        self.assert_response(self.test_auth_checkToken, **params)
 
     def test_contacts_getList(self):
-        self.assert_methods(self.test_contacts_getList)
+        self.assert_response(self.test_contacts_getList)
 
     def test_groups_getList(self):
-        self.assert_methods(self.test_groups_getList)
+        self.assert_response(self.test_groups_getList)
 
     def test_lists_getList(self):
-        self.assert_methods(self.test_lists_getList)
+        self.assert_response(self.test_lists_getList)
 
     def test_locations_getList(self):
-        self.assert_methods(self.test_locations_getList)
+        self.assert_response(self.test_locations_getList)
 
     def test_settings_getList(self):
-        self.assert_methods(self.test_settings_getList)
+        self.assert_response(self.test_settings_getList)
 
     def test_tasks_getList(self):
-        self.assert_methods(self.test_tasks_getList, 'lists')
+        self.assert_response(self.test_tasks_getList, 'lists')
 
     def test_timezones_getList(self):
-        self.assert_methods(self.test_timezones_getList)
+        self.assert_response(self.test_timezones_getList)