comparison tests/conftest.py @ 666:81d9c3a3a0b5

internal: Get rid of the whole "sub cache" business. * Compute cache keys up front, so the cache directory is only chosen once. * Buffer up config variants to apply before loading the config. Makes it possible to cache variant-resulting configs, too. * Make a factory class to reuse the logic that creates the `PieCrust` object correctly for multi-process workers and such. * Add a test.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 03 Mar 2016 08:22:41 -0800
parents 5dc13c816045
children d6403c21bdea
comparison
equal deleted inserted replaced
665:5dc13c816045 666:81d9c3a3a0b5
320 expected_output = self.spec.get('out') 320 expected_output = self.spec.get('out')
321 expected_contains = self.spec.get('out_contains') 321 expected_contains = self.spec.get('out_contains')
322 322
323 from werkzeug.test import Client 323 from werkzeug.test import Client
324 from werkzeug.wrappers import BaseResponse 324 from werkzeug.wrappers import BaseResponse
325 from piecrust.app import PieCrustFactory
325 from piecrust.serving.server import Server 326 from piecrust.serving.server import Server
326 with mock_fs_scope(fs): 327 with mock_fs_scope(fs):
327 server = Server(fs.path('/kitchen')) 328 appfactory = PieCrustFactory(fs.path('/kitchen'))
329 server = Server(appfactory)
328 test_app = self._TestApp(server) 330 test_app = self._TestApp(server)
329 client = Client(test_app, BaseResponse) 331 client = Client(test_app, BaseResponse)
330 resp = client.get(url) 332 resp = client.get(url)
331 assert expected_status == resp.status_code 333 assert expected_status == resp.status_code
332 334