def setUp(self): super(PolicyTestCase, self).setUp() self.rules = { "true": [], "armada:validate_manifest": [], "armada:create_endpoints": [["false:false"]] } self.useFixture(fixtures.RealPolicyFixture(False)) self._set_rules() self.credentials = {} self.target = {}
def setUp(self): super(PolicyTestCase, self).setUp() self.rules = { "true": [], "example:allowed": [], "example:disallowed": [["false:false"]] } self.useFixture(fixtures.RealPolicyFixture(False)) self._set_rules() self.credentials = {} self.target = {}
def setUp(self): super(BaseControllerTest, self).setUp() # Override the default configuration file lookup with references to # the sample configuration files to avoid oslo.conf errors when # creating the server below. current_dir = os.path.dirname(os.path.realpath(__file__)) sample_conf_dir = os.path.join(current_dir, os.pardir, os.pardir, os.pardir, os.pardir, 'etc', 'armada') sample_conf_files = ['api-paste.ini', 'armada.conf.sample'] with mock.patch.object(armada.conf, '_get_config_files') as mock_get_config_files: mock_get_config_files.return_value = [ os.path.join(sample_conf_dir, x) for x in sample_conf_files ] self.app = falcon_testing.TestClient( server.create(enable_middleware=False)) self.policy = self.useFixture(fixtures.RealPolicyFixture())
def setUp(self): super(BaseControllerTest, self).setUp() # Override the default configuration file lookup with references to # the sample configuration files to avoid oslo.conf errors when # creating the server below. current_dir = os.path.dirname(os.path.realpath(__file__)) sample_conf_dir = os.path.join(current_dir, os.pardir, os.pardir, os.pardir, os.pardir, 'etc', 'armada') sample_conf_files = ['api-paste.ini', 'armada.conf.sample'] with mock.patch.object(armada.conf, '_get_config_files') as mock_get_config_files: mock_get_config_files.return_value = [ os.path.join(sample_conf_dir, x) for x in sample_conf_files ] # FIXME(fmontei): Workaround for the fact that `armada.api` always # calls `create()` via `api = create()` at the bottom of the module # which invokes oslo.conf functionality that has yet to be set up # properly in this module. server = importlib.import_module('armada.api.server') self.app = falcon_testing.TestClient( server.create(enable_middleware=False)) self.policy = self.useFixture(fixtures.RealPolicyFixture())