예제 #1
0
    async def test_delete_vault_ec2_client_configuration(self, test_label, mount_point, requests_mocker):
        expected_status_code = 204
        mock_url = 'http://127.0.0.1:8200/v1/auth/{0}/config/client'.format(
            'aws-ec2' if mount_point is None else mount_point
        )
        requests_mocker.register_uri(
            method='DELETE',
            url=mock_url,
            status_code=expected_status_code,
        )
        client = AsyncClient()

        if mount_point is None:
            actual_response = await client.delete_vault_ec2_client_configuration()
        else:
            actual_response = await client.delete_vault_ec2_client_configuration(
                mount_point=mount_point
            )

        self.assertEqual(
            first=expected_status_code,
            second=actual_response.status,
        )
        await client.close()