# Path: chirp/common/mp3_header.py
# STEREO = 0
# JOINT_STEREO = 1
# DUAL_MONO = 2
# MONO = 3
# _CHANNELS_TO_STR = {
#     STEREO: 'stereo',
#     JOINT_STEREO: 'joint_stereo',
#     DUAL_MONO: 'dual_mono',
#     MONO: 'mono',
#     None: None,
# }
# _PROTECTED_TABLE = (True, False)
# _BIT_RATE_KBPS_TABLE = (0, 32, 40, 48, 56, 64, 80, 96,
#                         112, 128, 160, 192, 224, 256, 320)
# _SAMPLING_RATE_HZ_TABLE = (44100, 48000, 32000)
# _PADDING_TABLE = (False, True)
# _SAMPLES_PER_FRAME = 1152
# def _match_eq(x, y):
#     def __init__(self, sampling_rate_hz=None, bit_rate_kbps=None,
#                  channels=None, protected=None, padding=None):
#     def is_complete(self):
#     def match(self, hdr):
#     def __str__(self):
# def parse(data, offset=0):
# def find(data, expected_hdr=None):
# def from_mutagen(mutagen_mp3):
# class MP3Header(object):
# 
# Path: chirp/stream/block_injector.py
# class BlockInjector(message.MessageConsumer, message.MessageSource):
#     def __init__(self, src):
#     def _process_message(self, msg):
#     def set_block_payload(self, block_payload):
# 
# Path: chirp/stream/message.py
# CONNECTED = "Connected"        # New connection initiated.
# RESPONSE = "Response"          # HTTP response received.
# BLOCK = "Block"                # A chunk of raw data.
# FRAME = "Frame"                # An MP3 frame.
# ERROR = "Error"                # An error.
# CONNECT_TIMEOUT_ERROR = "Connect Timeout Error"
# CONNECT_ERROR = "Connect Error"
# REQUEST_ERROR = "Request Error"
# READ_TIMEOUT_ERROR = "Read Timeout Error"
# READ_ERROR = "Read Error"
# MISSING_HEADERS_ERROR = "Missing HTTP Headers Error"
# MALFORMED_HEADERS_ERROR = "Malformed HTTP Headers Error"
# BAD_REDIRECT_ERROR = "Bad Redirect Error"
# END_OF_STREAM_ERROR = "End of Stream Error"
# class Message(object):
# class MessageSource(object):
# class MessageConsumer(looper.Looper):
# class MessageTee(MessageConsumer):
#     def payload_sha1(self):
#     def payload_hex_sha1(self):
#     def __str__(self):
#     def set_error(self, error_type, err):
#     def is_error(self):
#     def is_end_of_stream(self):
#     def __init__(self):
#     def _add_message(self, msg):
#     def _add_stop_message(self):
#     def get_next_message(self, timeout=None):
#     def get_all_messages(self):
#     def wait_until_empty(self):
#     def __init__(self, src):
#     def _process_message(self, msg):
#     def _loop_once(self):
#     def __init__(self, input_src, num_outputs):
#     def _process_message(self, msg):


import unittest
from chirp.common import mp3_header
from chirp.stream import block_injector
from chirp.stream import message



class BlockInjectorTestCase(unittest.TestCase):

    def test_basic_injection(self):
        # A mock MP3 frame.
        mock_frame = message.Message()
        mock_frame.message_type = message.FRAME
        mock_frame.payload = "mock frame"

# Path: chirp/common/mp3_header.py
# STEREO = 0
# JOINT_STEREO = 1
# DUAL_MONO = 2
# MONO = 3
# _CHANNELS_TO_STR = {
#     STEREO: 'stereo',
#     JOINT_STEREO: 'joint_stereo',
#     DUAL_MONO: 'dual_mono',
#     MONO: 'mono',
#     None: None,
# }
# _PROTECTED_TABLE = (True, False)
# _BIT_RATE_KBPS_TABLE = (0, 32, 40, 48, 56, 64, 80, 96,
#                         112, 128, 160, 192, 224, 256, 320)
# _SAMPLING_RATE_HZ_TABLE = (44100, 48000, 32000)
# _PADDING_TABLE = (False, True)
# _SAMPLES_PER_FRAME = 1152
# def _match_eq(x, y):
#     def __init__(self, sampling_rate_hz=None, bit_rate_kbps=None,
#                  channels=None, protected=None, padding=None):
#     def is_complete(self):
#     def match(self, hdr):
#     def __str__(self):
# def parse(data, offset=0):
# def find(data, expected_hdr=None):
# def from_mutagen(mutagen_mp3):
# class MP3Header(object):
# 
# Path: chirp/stream/block_injector.py
# class BlockInjector(message.MessageConsumer, message.MessageSource):
#     def __init__(self, src):
#     def _process_message(self, msg):
#     def set_block_payload(self, block_payload):
# 
# Path: chirp/stream/message.py
# CONNECTED = "Connected"        # New connection initiated.
# RESPONSE = "Response"          # HTTP response received.
# BLOCK = "Block"                # A chunk of raw data.
# FRAME = "Frame"                # An MP3 frame.
# ERROR = "Error"                # An error.
# CONNECT_TIMEOUT_ERROR = "Connect Timeout Error"
# CONNECT_ERROR = "Connect Error"
# REQUEST_ERROR = "Request Error"
# READ_TIMEOUT_ERROR = "Read Timeout Error"
# READ_ERROR = "Read Error"
# MISSING_HEADERS_ERROR = "Missing HTTP Headers Error"
# MALFORMED_HEADERS_ERROR = "Malformed HTTP Headers Error"
# BAD_REDIRECT_ERROR = "Bad Redirect Error"
# END_OF_STREAM_ERROR = "End of Stream Error"
# class Message(object):
# class MessageSource(object):
# class MessageConsumer(looper.Looper):
# class MessageTee(MessageConsumer):
#     def payload_sha1(self):
#     def payload_hex_sha1(self):
#     def __str__(self):
#     def set_error(self, error_type, err):
#     def is_error(self):
#     def is_end_of_stream(self):
#     def __init__(self):
#     def _add_message(self, msg):
#     def _add_stop_message(self):
#     def get_next_message(self, timeout=None):
#     def get_all_messages(self):
#     def wait_until_empty(self):
#     def __init__(self, src):
#     def _process_message(self, msg):
#     def _loop_once(self):
#     def __init__(self, input_src, num_outputs):
#     def _process_message(self, msg):


# Path: chirp/stream/block_injector_test.py
import unittest
from chirp.common import mp3_header
from chirp.stream import block_injector
from chirp.stream import message




class BlockInjectorTestCase(unittest.TestCase):

    def test_basic_injection(self):
        # A mock MP3 frame.
        mock_frame = message.Message()
        mock_frame.message_type = message.FRAME
        mock_frame.payload = "mock frame"

        mock_frame.mp3_header = mp3_header.MP3Header()