def __call__(self, *args, **kwargs): call = self.call if call.nargs != '*' and len(args) != call.nargs: raise TypeError('%s() takes exactly %s (%s given)' % (call.name, nice_number(call.nargs, 'argument'), nice_number(len(args)))) url = call.path params, http_extra = call.check_params(kwargs) if args: url = appendslash(url) + '/'.join(('%s' % a for a in args)) if call.append: url = appendslash(url) + call.append if not call.scheme: url = self.api.BASE_URL + url response = self.api.request(call, url, params, **http_extra) return response.on_finished.add_callback(self.callback)
def test_appendslash(self): self.assertEqual(appendslash('bla'), 'bla/') self.assertEqual(appendslash('bla/'), 'bla/')
def test_appendslash(self): self.assertEqual(appendslash("bla"), "bla/") self.assertEqual(appendslash("bla/"), "bla/")