예제 #1
0
 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())
예제 #2
0
 def setUp(self):
     super(APITestCase, self).setUp()
     self.app = server.create(middleware=False)