# Path: seal/lib/aligner/mapping.py
# class SimpleMapping(Mapping):
#     def __init__(self):
#         super(SimpleMapping, self).__init__()
#         self.__name = ""
#         self.__base_qualities = array.array('B')
#         self.__cigar = []
#         self.__tags = []
#         self.__seq = ""
# 
#     def set_name(self, name):
#         self.__name = name
# 
#     def set_base_qualities(self, bq):
#         if bq is not None and not isinstance(bq, array.array):
#             raise TypeError("Invalid type for base qualities (%s)" % str(type(bq)))
#         self.__base_qualities = bq
# 
#     def set_cigar(self, cig):
#         if cig is not None and not isinstance(cig, list):
#             raise TypeError("Invalid type for cigar (%s)" % str(type(cig)))
#         self.__cigar = cig
# 
#     def add_tag(self, tag):
#         self.__tags.append(tag)
# 
#     def set_seq_5(self, s):
#         self.__seq = s
# 
#     def get_name(self):
#         return self.__name
# 
#     def get_base_qualities(self):
#         return self.__base_qualities
# 
#     def get_cigar(self):
#         return self.__cigar
# 
#     def each_tag(self):
#         for t in self.__tags:
#             yield t
# 
#     def get_seq_5(self):
#         return self.__seq
# 
#     def get_seq_len(self):
#         return len(self.__seq)


import unittest
import array
import seal.lib.io.protobuf_mapping as io
import tseal.test_utils as tu
from seal.lib.aligner.mapping import SimpleMapping
        self.__try_and_compare_maps(self.mapping)

    def test_pos(self):
        self.mapping.pos = 280781134
        self.__try_and_compare_maps(self.mapping)

    def test_tid(self):
        self.mapping.tid = "chr19"
        self.__try_and_compare_maps(self.mapping)

    def test_ref_id(self):
        self.mapping.ref_id = 12
        self.__try_and_compare_maps(self.mapping)
        self.mapping.ref_id = 0
        self.__try_and_compare_maps(self.mapping)

    def test_no_ref_id(self):
        self.mapping.ref_id = None
        self.__try_and_compare_maps(self.mapping)

    def __try_and_compare_maps(self, mapping):
        self.protected_compare_seq_maps(mapping, self.__pipe_map_through(mapping))

    def __pipe_map_through(self, mapping):
        message = io.serialize_seq(mapping)
        return io.unserialize_seq(message)


class TestProtobufPairMapping(TestProtobufSerialization):
    def setUp(self):

# Path: seal/lib/aligner/mapping.py
# class SimpleMapping(Mapping):
#     def __init__(self):
#         super(SimpleMapping, self).__init__()
#         self.__name = ""
#         self.__base_qualities = array.array('B')
#         self.__cigar = []
#         self.__tags = []
#         self.__seq = ""
# 
#     def set_name(self, name):
#         self.__name = name
# 
#     def set_base_qualities(self, bq):
#         if bq is not None and not isinstance(bq, array.array):
#             raise TypeError("Invalid type for base qualities (%s)" % str(type(bq)))
#         self.__base_qualities = bq
# 
#     def set_cigar(self, cig):
#         if cig is not None and not isinstance(cig, list):
#             raise TypeError("Invalid type for cigar (%s)" % str(type(cig)))
#         self.__cigar = cig
# 
#     def add_tag(self, tag):
#         self.__tags.append(tag)
# 
#     def set_seq_5(self, s):
#         self.__seq = s
# 
#     def get_name(self):
#         return self.__name
# 
#     def get_base_qualities(self):
#         return self.__base_qualities
# 
#     def get_cigar(self):
#         return self.__cigar
# 
#     def each_tag(self):
#         for t in self.__tags:
#             yield t
# 
#     def get_seq_5(self):
#         return self.__seq
# 
#     def get_seq_len(self):
#         return len(self.__seq)


# Path: tests/tseal/lib/io/test_protobuf_mapping.py
import unittest
import array
import seal.lib.io.protobuf_mapping as io
import tseal.test_utils as tu
from seal.lib.aligner.mapping import SimpleMapping

        self.__try_and_compare_maps(self.mapping)

    def test_pos(self):
        self.mapping.pos = 280781134
        self.__try_and_compare_maps(self.mapping)

    def test_tid(self):
        self.mapping.tid = "chr19"
        self.__try_and_compare_maps(self.mapping)

    def test_ref_id(self):
        self.mapping.ref_id = 12
        self.__try_and_compare_maps(self.mapping)
        self.mapping.ref_id = 0
        self.__try_and_compare_maps(self.mapping)

    def test_no_ref_id(self):
        self.mapping.ref_id = None
        self.__try_and_compare_maps(self.mapping)

    def __try_and_compare_maps(self, mapping):
        self.protected_compare_seq_maps(mapping, self.__pipe_map_through(mapping))

    def __pipe_map_through(self, mapping):
        message = io.serialize_seq(mapping)
        return io.unserialize_seq(message)


class TestProtobufPairMapping(TestProtobufSerialization):
    def setUp(self):

        self.pair = (SimpleMapping(), SimpleMapping())