# 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
    def verify(self, meta, item):
        assert_string_equal(meta.get('xml'), TestParserExample1.xml)

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

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

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


@pytest.mark.plugin('slicer_cli_web')
class TestParserExample2:
    xml = read_example_file('Example2', 'xml')
    json = read_example_file('Example2', 'json')
    yaml = read_example_file('Example2', 'yaml')

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

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

    def test_json(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

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

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

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

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


@pytest.mark.plugin('slicer_cli_web')
class TestParserExample2:
    xml = read_example_file('Example2', 'xml')
    json = read_example_file('Example2', 'json')
    yaml = read_example_file('Example2', 'yaml')

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

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

    def test_json(self, admin, item):

        meta = parse_json_desc(item, dict(json=TestParserExample2.json), admin)