# Path: slicer_cli_web/models/parser.py
# def parse_xml_desc(item, desc, user):
#     return _parse_xml_desc(item, user, desc['xml'])
# 
# def parse_json_desc(item, desc, user):
#     data = json.loads(desc['json'])
# 
#     return _parse_json_desc(item, user, data)
# 
# def parse_yaml_desc(item, desc, user):
#     data = yaml.safe_load(desc['yaml'])
# 
#     return _parse_json_desc(item, user, data)


import pytest
import re
import os
from slicer_cli_web.models.parser import parse_xml_desc, parse_json_desc, parse_yaml_desc
        from girder.models.item import Item
    xml = read_file('parser_params_simple.xml')
    json = read_file('parser_params_simple.json')
    yaml = read_file('parser_params_simple.yaml')

    def verify(self, meta, item):
        assert_string_equal(meta.get('xml'), TestParserParamsSimple.xml)

    def test_xml(self, admin, item):
        meta = parse_xml_desc(item, dict(xml=TestParserParamsSimple.xml), admin)
        self.verify(meta, item)

    def test_json(self, admin, item):
        meta = parse_json_desc(item, dict(json=TestParserParamsSimple.json), admin)
        self.verify(meta, item)

    def test_yaml(self, admin, item):
        meta = parse_yaml_desc(item, dict(yaml=TestParserParamsSimple.yaml), admin)
        self.verify(meta, item)


@pytest.mark.plugin('slicer_cli_web')
class TestParserParamsAdvanced:
    xml = read_file('parser_params_advanced.xml')
    json = read_file('parser_params_advanced.json')
    yaml = read_file('parser_params_advanced.yaml')

    def verify(self, meta, item):
        assert_string_equal(meta.get('xml'), TestParserParamsAdvanced.xml)

    def test_xml(self, admin, item):

# Path: slicer_cli_web/models/parser.py
# def parse_xml_desc(item, desc, user):
#     return _parse_xml_desc(item, user, desc['xml'])
# 
# def parse_json_desc(item, desc, user):
#     data = json.loads(desc['json'])
# 
#     return _parse_json_desc(item, user, data)
# 
# def parse_yaml_desc(item, desc, user):
#     data = yaml.safe_load(desc['yaml'])
# 
#     return _parse_json_desc(item, user, data)


# Path: tests/test_parser.py
import pytest
import re
import os
from slicer_cli_web.models.parser import parse_xml_desc, parse_json_desc, parse_yaml_desc
        from girder.models.item import Item

    xml = read_file('parser_params_simple.xml')
    json = read_file('parser_params_simple.json')
    yaml = read_file('parser_params_simple.yaml')

    def verify(self, meta, item):
        assert_string_equal(meta.get('xml'), TestParserParamsSimple.xml)

    def test_xml(self, admin, item):
        meta = parse_xml_desc(item, dict(xml=TestParserParamsSimple.xml), admin)
        self.verify(meta, item)

    def test_json(self, admin, item):
        meta = parse_json_desc(item, dict(json=TestParserParamsSimple.json), admin)
        self.verify(meta, item)

    def test_yaml(self, admin, item):
        meta = parse_yaml_desc(item, dict(yaml=TestParserParamsSimple.yaml), admin)
        self.verify(meta, item)


@pytest.mark.plugin('slicer_cli_web')
class TestParserParamsAdvanced:
    xml = read_file('parser_params_advanced.xml')
    json = read_file('parser_params_advanced.json')
    yaml = read_file('parser_params_advanced.yaml')

    def verify(self, meta, item):
        assert_string_equal(meta.get('xml'), TestParserParamsAdvanced.xml)

    def test_xml(self, admin, item):

        meta = parse_xml_desc(item, dict(xml=TestParserParamsAdvanced.xml), admin)