# Path: soco/music_services/data_structures.py
# _LOG = logging.getLogger(__name__)
# CLASSES = {}
# BOOL_STRS = {"true", "false"}
# def get_class(class_key):
# def parse_response(service, response, search_type):
# def form_uri(item_id, service, is_track):
# def bool_str(string):
#     def __init__(self, metadata_dict):
#     def __getattr__(self, key):
#     def __init__(
#         self,
#         item_id,
#         desc,  # pylint: disable=too-many-arguments
#         resources,
#         uri,
#         metadata_dict,
#         music_service=None,
#     ):
#     def from_music_service(cls, music_service, content_dict):
#     def __str__(self):
#     def to_element(self, include_namespaces=False):
# class MetadataDictBase:
# class MusicServiceItem(MetadataDictBase):
# class TrackMetadata(MetadataDictBase):
# class StreamMetadata(MetadataDictBase):
# class MediaMetadata(MusicServiceItem):
# class MediaCollection(MusicServiceItem):


from collections import OrderedDict
from unittest.mock import PropertyMock, Mock, patch
from soco.music_services import data_structures
import pytest
    music_service.sonos_uri_from_id.return_value = "99"

    # Test non track uri
    non_track_uri = data_structures.form_uri("dummy_id", None, False)
    assert non_track_uri == "x-rincon-cpcontainer:dummy_id"

    # Test track uri
    _ = data_structures.form_uri("dummy_id", music_service, True)
    music_service.sonos_uri_from_id.assert_called_once_with("dummy_id")


def test_bool_str():
    """Test the bool_str function"""
    assert data_structures.bool_str("true") is True
    assert data_structures.bool_str("false") is False
    with pytest.raises(ValueError):
        data_structures.bool_str("dummy")


class TestMetadataDictBase:
    """Tests for the MetadataDictBase class"""

    def test_init(self):
        """Test normal __init__ functionality; metadata stored and camel case
        names coverted

        """
        metadata_dict = {
            "superTitle": "Dummy Title",
        }

# Path: soco/music_services/data_structures.py
# _LOG = logging.getLogger(__name__)
# CLASSES = {}
# BOOL_STRS = {"true", "false"}
# def get_class(class_key):
# def parse_response(service, response, search_type):
# def form_uri(item_id, service, is_track):
# def bool_str(string):
#     def __init__(self, metadata_dict):
#     def __getattr__(self, key):
#     def __init__(
#         self,
#         item_id,
#         desc,  # pylint: disable=too-many-arguments
#         resources,
#         uri,
#         metadata_dict,
#         music_service=None,
#     ):
#     def from_music_service(cls, music_service, content_dict):
#     def __str__(self):
#     def to_element(self, include_namespaces=False):
# class MetadataDictBase:
# class MusicServiceItem(MetadataDictBase):
# class TrackMetadata(MetadataDictBase):
# class StreamMetadata(MetadataDictBase):
# class MediaMetadata(MusicServiceItem):
# class MediaCollection(MusicServiceItem):


# Path: tests/test_music_service_data_structures.py
from collections import OrderedDict
from unittest.mock import PropertyMock, Mock, patch
from soco.music_services import data_structures
import pytest

    music_service.sonos_uri_from_id.return_value = "99"

    # Test non track uri
    non_track_uri = data_structures.form_uri("dummy_id", None, False)
    assert non_track_uri == "x-rincon-cpcontainer:dummy_id"

    # Test track uri
    _ = data_structures.form_uri("dummy_id", music_service, True)
    music_service.sonos_uri_from_id.assert_called_once_with("dummy_id")


def test_bool_str():
    """Test the bool_str function"""
    assert data_structures.bool_str("true") is True
    assert data_structures.bool_str("false") is False
    with pytest.raises(ValueError):
        data_structures.bool_str("dummy")


class TestMetadataDictBase:
    """Tests for the MetadataDictBase class"""

    def test_init(self):
        """Test normal __init__ functionality; metadata stored and camel case
        names coverted

        """
        metadata_dict = {
            "superTitle": "Dummy Title",
        }

        metadata = data_structures.MetadataDictBase(metadata_dict)