summaryrefslogtreecommitdiffstats
path: root/tests/unit/middleware
Commit message (Collapse)AuthorAgeFilesLines
* python3: python3 binary/text data compatbilityChuck Short2013-05-311-5/+5
| | | | | | | | | | | | | Python3 enforces the distinction between byte strings far more rigorously than Python 2 does; binary data cannot be automatically coerced to or from text data. Use six to provide a fake file object for textual data. It provides an alias for StringIO.StringIO in python2 and io.StringIO in python3 Change-Id: I65897bb0cca2cbeb5819a769b98645c9eb066401 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Use stubout in test_correlation_idMark McLoughlin2013-05-201-3/+2
| | | | | | | Best to use stubout for stubbing out methods like this. That way they get properly unstubbed on failure. Change-Id: I61dc96d01e331e8d811b8f24137e8f738cf09215
* Add Middleware for correlation_idAditi Raveesh2013-05-151-0/+51
| | | | | | | | | | The middleware generates the 'correlation_id' if it is not already present in the request header. This 'correlation_id' can be used to enable more effective debugging of requests that span multiple services. Implements: blueprint create-a-unified-correlation-id Change-Id: Ibc06a5b05b628e0b640e9299c79127ecbf9c684e
* Add middleware to limit size of HTTP requests.Dan Prince2013-04-231-0/+100
| | | | | | | | | Adds a new RequestBodySizeLimiter middleware to guard against really large HTTP requests. The default max request size is 112k although this limit is configurable via the 'max_request_body_size' config parameter. Change-Id: I76248feed5c77f678b8a43f364d4f1e0794ab910
* Fix Copyright Headers - Rename LLC to FoundationDavanum Srinivas2013-03-111-1/+1
| | | | | | One code change, rest are in headers Change-Id: I73f59681358629e1ad74e49d3d3ca13fcb5c2eb1
* Replace direct use of testtools BaseTestCase.Monty Taylor2013-01-241-4/+3
| | | | | | | | | Using the BaseTestCase across the tests in the tree lets us put in log fixtures and consistently handle mox and stubout. Part of blueprint grizzly-testtools. Change-Id: Iba7eb2c63b0c514009b2c28e5930b27726a147b0
* Use testtools as test base class.Monty Taylor2013-01-241-3/+3
| | | | | | | | | | | | | On the path to testr migration, we need to replace the unittest base classes with testtools. Replace tearDown with addCleanup, addCleanup is more resilient than tearDown. The fixtures library has excellent support for managing and cleaning tempfiles. Use it. Replace skip_ with testtools.skipTest Part of blueprint grizzly-testtools. Change-Id: I45e11bbb1ff9b31f3278d3b016737dcb7850cd98
* Change behavior in utils.import_object().Russell Bryant2012-04-111-1/+1
| | | | | | | | | | | | | | | | | | | Fix bug 972859. Prior to this patch, utils.import_object(foo) and utils.import_class(foo) would return the same thing if foo was the path to a class. This patch changes utils.import_object() to return an instance of the class, instead, also allowing you to pass in arguments to the constructor. This patch also removes the odd behavior of import_object() to be able to also import a module. Instead, a new function import_module() has been added. Finally, the three import helpers have been moved to a new module, importutils. Change-Id: Ia2ea64c965692f8c3a29adec332dd93a83980070
* add context middleware testsJason Kölker2011-12-012-0/+79