def system_collection_resource(): systems = [system for system in app.systems.systems if not api_utils.instance_denied(identity=system)] app.logger.debug('Serving systems list') return flask.render_template( 'system_collection.json', system_count=len(systems), systems=systems)
def test_instance_denied_disallow_some(self): self.assertTrue(api_utils.instance_denied(identity='b'))
def test_instance_denied_allow_some(self): self.assertFalse(api_utils.instance_denied(identity='a'))
def test_instance_denied_undefined_option(self): with mock.patch.dict(main.app.config): main.app.config.pop('SUSHY_EMULATOR_ALLOWED_INSTANCES', None) self.assertFalse(api_utils.instance_denied(identity='a'))