# 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
    a_clean = white.sub(a, '')
    b_clean = white.sub(b, '')

    assert a_clean == b_clean


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

    def verify(self, meta, item):

        assert_string_equal(meta.get('xml'), TestParserSimple.xml)
        assert meta.get('category') == 'A'
        assert meta.get('version') == 'V'
        assert meta.get('license') == 'L'
        assert meta.get('contributor') == 'C'
        assert meta.get('acknowledgements') == 'A'

        assert item.get('description') == '**T**\n\nD'

        files = list(Item().childFiles(item))
        assert len(files) == 1
        link = files[0]
        assert link['name'] == 'Documentation'
        assert link['linkUrl'] == 'https://github.com'

    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

    a_clean = white.sub(a, '')
    b_clean = white.sub(b, '')

    assert a_clean == b_clean


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

    def verify(self, meta, item):

        assert_string_equal(meta.get('xml'), TestParserSimple.xml)
        assert meta.get('category') == 'A'
        assert meta.get('version') == 'V'
        assert meta.get('license') == 'L'
        assert meta.get('contributor') == 'C'
        assert meta.get('acknowledgements') == 'A'

        assert item.get('description') == '**T**\n\nD'

        files = list(Item().childFiles(item))
        assert len(files) == 1
        link = files[0]
        assert link['name'] == 'Documentation'
        assert link['linkUrl'] == 'https://github.com'

    def test_xml(self, admin, item):

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