Exemple #1
0
    def setUp(self):
        super(S3TokenMiddlewareTestBase, self).setUp()
        self.logger = fixtures.FakeLogger(level=logging.DEBUG)
        self.logger.setUp()
        self.time_patcher = mock.patch.object(time, 'time', lambda: 1234)
        self.time_patcher.start()

        self.app = FakeApp()
        self.conf = {
            'auth_uri': self.TEST_AUTH_URI,
        }
        self.middleware = s3token.S3Token(self.app, self.conf)

        self.requests_mock = rm_fixture.Fixture()
        self.requests_mock.setUp()
Exemple #2
0
 def setUp(self):
     super(S3TokenMiddlewareTestDeferredAuth, self).setUp()
     self.conf['delay_auth_decision'] = 'yes'
     self.middleware = s3token.S3Token(FakeApp(), self.conf)
Exemple #3
0
 def make_middleware(self, conf):
     with mock.patch('swift.common.middleware.s3api.s3token.get_logger',
                     return_value=self.logger):
         return s3token.S3Token(self.app, conf)