Did I find the right examples for you? yes no

All Samples(26)  |  Call(26)  |  Derive(0)  |  Import(0)

            def positional_wrapper(*args, **kwargs):
      if len(args) > max_positional_args:
        plural_s = ''
        if max_positional_args != 1:
          plural_s = 's'
        raise TypeError('%s() takes at most %d positional argument%s '
                        '(%d given)' % (wrapped.__name__,
                                        max_positional_args,
                                        plural_s, len(args)))
      return wrapped(*args, **kwargs)
        


src/p/r/protorpc-0.9.1/protorpc/wsgi/util_test.py   protorpc(Download)
from protorpc.wsgi import util as wsgi_util
 
APP1 = wsgi_util.static_page('App1')
APP2 = wsgi_util.static_page('App2')
NOT_FOUND = wsgi_util.error(httplib.NOT_FOUND)
  def testDefault(self):
    default_page = wsgi_util.static_page()
    self.ResetServer(default_page)
    status, reason, content, headers = self.DoHttpRequest()
    self.assertEquals(200, status)
  def testHasContent(self):
    default_page = wsgi_util.static_page('my content')
    self.ResetServer(default_page)
    status, reason, content, headers = self.DoHttpRequest()
    self.assertEquals(200, status)
  def testHasContentType(self):
    default_page = wsgi_util.static_page(content_type='text/plain')
    self.ResetServer(default_page)
    status, reason, content, headers = self.DoHttpRequest()
    self.assertEquals(200, status)

src/p/r/protorpc-standalone-0.9.1/protorpc/wsgi/util_test.py   protorpc-standalone(Download)
from protorpc.wsgi import util as wsgi_util
 
APP1 = wsgi_util.static_page('App1')
APP2 = wsgi_util.static_page('App2')
NOT_FOUND = wsgi_util.error(httplib.NOT_FOUND)
  def testDefault(self):
    default_page = wsgi_util.static_page()
    self.ResetServer(default_page)
    status, reason, content, headers = self.DoHttpRequest()
    self.assertEquals(200, status)
  def testHasContent(self):
    default_page = wsgi_util.static_page('my content')
    self.ResetServer(default_page)
    status, reason, content, headers = self.DoHttpRequest()
    self.assertEquals(200, status)
  def testHasContentType(self):
    default_page = wsgi_util.static_page(content_type='text/plain')
    self.ResetServer(default_page)
    status, reason, content, headers = self.DoHttpRequest()
    self.assertEquals(200, status)

src/p/r/protorpc-0.9.1/protorpc/transport_test.py   protorpc(Download)
    def expect_content_type(environ, start_response):
      self.assertEquals(expected_content_type, environ['CONTENT_TYPE'])
      app = wsgi_util.static_page('', content_type=environ['CONTENT_TYPE'])
      return app(environ, start_response)
 

src/p/r/protorpc-standalone-0.9.1/protorpc/transport_test.py   protorpc-standalone(Download)
    def expect_content_type(environ, start_response):
      self.assertEquals(expected_content_type, environ['CONTENT_TYPE'])
      app = wsgi_util.static_page('', content_type=environ['CONTENT_TYPE'])
      return app(environ, start_response)