Ejemplo n.º 1
0
 def setUp(self):
     self._transport = MagicMock()
     self._response = APIResponse({}, {}, 200)
     self._transport.post.return_value = self._response
     self._transport.get.return_value = self._response
     self._transport.put.return_value = self._response
     self._transport.delete.return_value = self._response
     self._transport.patch.return_value = self._response
     self._directory_client = DirectoryClient(uuid4(), self._transport)
Ejemplo n.º 2
0
 def setUp(self):
     self._transport = MagicMock()
     self._response = APIResponse({}, {}, 200)
     self._transport.post.return_value = self._response
     self._transport.get.return_value = self._response
     self._transport.put.return_value = self._response
     self._transport.delete.return_value = self._response
     self._transport.patch.return_value = self._response
     self._directory_id = uuid4()
     self._expected_subject = 'dir:{}'.format(str(self._directory_id))
     self._directory_client = DirectoryClient(self._directory_id,
                                              self._transport)
Ejemplo n.º 3
0
    def setUp(self):
        patcher = patch("launchkey.clients.directory.XiovJWTService")
        self._x_iov_jwt_service_patch = patcher.start().return_value
        self._x_iov_jwt_service_patch.decrypt_jwe.return_value = dumps(
            {
                "type": "DEVICE_LINK_COMPLETION",
                "device_public_key": "public key",
                "device_public_key_id": "public key id",
                "device_id": "device id"
            }
        )
        self.addCleanup(patcher.stop)

        self._directory_id = uuid4()
        self._transport = MagicMock(spec=JOSETransport)
        self._headers = {"X-IOV-JWT": "jwt", "Other Header": "jwt"}
        self.client = DirectoryClient(self._directory_id, self._transport)
Ejemplo n.º 4
0
 def setUp(self):
     self._directory_id = uuid4()
     client = DirectoryClient(self._directory_id, MagicMock())
     self._expected_base_endpoint = '/directory/v3/services'
     self._expected_subject = 'dir:{}'.format(str(self._directory_id))
     self.setup_client(client)
Ejemplo n.º 5
0
 def make_directory_client(self):
     """
     Retrieves a client to make directory calls.
     :return: launchkey.clients.DirectoryClient
     """
     return DirectoryClient(self._issuer_id, self._transport)
Ejemplo n.º 6
0
 def setUp(self):
     client = DirectoryClient(uuid4(), MagicMock())
     self.setup_client(client)