예제 #1
0
    def setUp(self):
        super(TestObjectStoreProxy, self).setUp()
        self.transport = transport.Transport(accept=transport.JSON)
        self.auth = fakes.FakeAuthenticator()
        self.session = session.Session(self.transport, self.auth)

        self.proxy = _proxy.Proxy(self.session)
예제 #2
0
 def setUp(self):
     super(TestSession, self).setUp()
     self.xport = fakes.FakeTransport()
     self.auth = fakes.FakeAuthenticator()
     self.serv = service_filter.ServiceFilter(service_type='identity')
     self.sess = session.Session(self.xport, self.auth)
     self.expected = {'headers': {'X-Auth-Token': self.auth.TOKEN}}
예제 #3
0
    def setUp(self):
        super(Test_containers, self).setUp()
        self.transport = transport.Transport(accept=transport.JSON)
        self.auth = fakes.FakeAuthenticator()
        self.session = session.Session(self.transport, self.auth)

        self.proxy = _proxy.Proxy(self.session)

        self.containers_body = []
        for i in range(3):
            self.containers_body.append(
                {six.text_type("name"): six.text_type("container%d" % i)})
예제 #4
0
    def setUp(self):
        super(Test_objects, self).setUp()
        self.transport = transport.Transport(accept=transport.JSON)
        self.auth = fakes.FakeAuthenticator()
        self.session = session.Session(self.transport, self.auth)

        self.proxy = _proxy.Proxy(self.session)

        self.container_name = six.text_type("my_container")

        self.objects_body = []
        for i in range(3):
            self.objects_body.append(
                {six.text_type("name"): six.text_type("object%d" % i)})

        # Returned object bodies have their container inserted.
        self.returned_objects = []
        for ob in self.objects_body:
            ob[six.text_type("container")] = self.container_name
            self.returned_objects.append(ob)
        self.assertEqual(len(self.objects_body), len(self.returned_objects))