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'))
Пример #2
0
    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)
Пример #4
0
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()
Пример #6
0
 def tearDown(self):
     self.admin_app = None
     os.remove(tests.tmpdir("no_admin_token_auth-paste.ini"))
     super(TestNoAdminTokenAuth, self).tearDown()