def test_wsgi_middleware_lookup_injector(): injector_middleware = make_injector(None, {}) # Default is the topbottom injector assert isinstance(injector_middleware.injector, TopBottomInjector) with pytest.raises(ConfigurationError): make_injector(None, {}, injector='foo')
def test_wsgi_middleware_lookup_injector_register(injectors): with pytest.raises(ConfigurationError): make_injector(None, {}, injector='top') injectors.add_injector(TopInjector) # After registering, no longer raise a Configuration Error. make_injector(None, {}, injector='top')
def test_injector_config(): d = { 'versioning': 't', 'recompute_hashes': 'false', 'bottom': 'True', 'force_bottom': 'False', 'rollup': 0, } injector = make_injector(None, {}, **d) assert injector.app is None assert injector.config == { 'versioning': True, 'recompute_hashes': False, }