# Path: crosscompute/scripts/serve.py
# def do(arguments=None):
# def configure_argument_parser_for_serving(a):
# def serve_with(automation, args):
# def serve(
#         automation, host=HOST, port=PORT, with_browser=True,
#         is_static=False, is_production=False,
#         base_uri='', allowed_origins=None,
#         disk_poll_in_milliseconds=DISK_POLL_IN_MILLISECONDS,
#         disk_debounce_in_milliseconds=DISK_DEBOUNCE_IN_MILLISECONDS):
# L = getLogger(__name__)


from crosscompute.models import Result
from crosscompute.types import DataItem
from crosscompute.scripts.serve import (
    get_result_file_response, get_tool_file_response,
    parse_result_relative_path, parse_template_parts)
from invisibleroads_macros.disk import copy_path, make_folder
from invisibleroads_macros.exceptions import BadPath
from invisibleroads_uploads.models import Upload
from invisibleroads_uploads.tests import prepare_field_storage
from os.path import join
from pyramid.httpexceptions import HTTPBadRequest, HTTPForbidden, HTTPNotFound
from pytest import raises
from webob.multidict import MultiDict
from conftest import TOOL_FOLDER, WheeType



class TestParseTemplate(object):

    def test_accept_whitespace(self):
        data_item = DataItem('x', '')
        data_items = [data_item]
        assert data_items == parse_template_parts('{x}', data_items)

# Path: crosscompute/scripts/serve.py
# def do(arguments=None):
# def configure_argument_parser_for_serving(a):
# def serve_with(automation, args):
# def serve(
#         automation, host=HOST, port=PORT, with_browser=True,
#         is_static=False, is_production=False,
#         base_uri='', allowed_origins=None,
#         disk_poll_in_milliseconds=DISK_POLL_IN_MILLISECONDS,
#         disk_debounce_in_milliseconds=DISK_DEBOUNCE_IN_MILLISECONDS):
# L = getLogger(__name__)


# Path: experiments/0.7/tests/x_serve.py
from crosscompute.models import Result
from crosscompute.types import DataItem
from crosscompute.scripts.serve import (
    get_result_file_response, get_tool_file_response,
    parse_result_relative_path, parse_template_parts)
from invisibleroads_macros.disk import copy_path, make_folder
from invisibleroads_macros.exceptions import BadPath
from invisibleroads_uploads.models import Upload
from invisibleroads_uploads.tests import prepare_field_storage
from os.path import join
from pyramid.httpexceptions import HTTPBadRequest, HTTPForbidden, HTTPNotFound
from pytest import raises
from webob.multidict import MultiDict
from conftest import TOOL_FOLDER, WheeType




class TestParseTemplate(object):

    def test_accept_whitespace(self):
        data_item = DataItem('x', '')
        data_items = [data_item]
        assert data_items == parse_template_parts('{x}', data_items)

        assert data_items == parse_template_parts('{x }', data_items)