def setUp(self): super(TestNoAdminTokenAuth, self).setUp() self.load_backends() _generate_paste_config() self.admin_app = webtest.TestApp( self.loadapp(tests.tmpdir('no_admin_token_auth'), name='admin'), extra_environ=dict(REMOTE_ADDR='127.0.0.1'))
def setUp(self): super(TestNoAdminTokenAuth, self).setUp() self.load_backends() _generate_paste_config() self.admin_app = webtest.TestApp( self.loadapp(tests.tmpdir("no_admin_token_auth"), name="admin"), extra_environ=dict(REMOTE_ADDR="127.0.0.1") )
def _generate_paste_config(): # Generate a file, based on keystone-paste.ini, that doesn't include # admin_token_auth in the pipeline with open(tests.etcdir('keystone-paste.ini'), 'r') as f: contents = f.read() new_contents = contents.replace(' admin_token_auth ', ' ') with open(tests.tmpdir('no_admin_token_auth-paste.ini'), 'w') as f: f.write(new_contents)
def _generate_paste_config(): # Generate a file, based on keystone-paste.ini, that doesn't include # admin_token_auth in the pipeline with open(tests.etcdir("keystone-paste.ini"), "r") as f: contents = f.read() new_contents = contents.replace(" admin_token_auth ", " ") with open(tests.tmpdir("no_admin_token_auth-paste.ini"), "w") as f: f.write(new_contents)
def tearDown(self): self.admin_app = None os.remove(tests.tmpdir('no_admin_token_auth-paste.ini')) super(TestNoAdminTokenAuth, self).tearDown()
def tearDown(self): self.admin_app = None os.remove(tests.tmpdir("no_admin_token_auth-paste.ini")) super(TestNoAdminTokenAuth, self).tearDown()