# Path: dark/cigar.py
# (CINS_STR, CDEL_STR, CMATCH_STR, CEQUAL_STR, CDIFF_STR,
#  CHARD_CLIP_STR) = 'IDM=XH'
# def dna2cigar(s1, s2, concise=False):
# def makeCigar(reference, query, noEdgeInsertions=True):
# def cigarTuplesToOperations(tuples, includeHardClip=True):
# def softClippedOffset(offset, pairs, cigarOperations):
# def insertionOffset(offset, pairs, cigarOperations):


from unittest import TestCase
from pysam import CSOFT_CLIP, CHARD_CLIP, CMATCH, CINS
from dark.cigar import (
    CINS_STR, CDEL_STR, CMATCH_STR, CEQUAL_STR, CDIFF_STR,
    dna2cigar, makeCigar, cigarTuplesToOperations, softClippedOffset,
    insertionOffset)

    def testMatchOneBefore(self):
        """
        Test that an inserted base one site before a non-inserted site
        returns the correct offset.
        """
        self.assertEqual(
            (False, 10),
            insertionOffset(0,
                            ((0, None), (1, 10)),
                            (CINS, CMATCH)))

    def testMatchTwoBefore(self):
        """
        Test that an inserted base two sites before a non-inserted site
        returns the correct offset.
        """
        self.assertEqual(
            (False, 10),
            insertionOffset(0,
                            ((0, None), (1, None), (2, 10)),
                            (CINS, CINS, CMATCH)))

    def testMatchTwoBeforeWithHardClips(self):
        """
        Test that an inserted base two sites before a non-inserted site
        returns the correct offset.
        """
        self.assertEqual(
            (False, 10),

# Path: dark/cigar.py
# (CINS_STR, CDEL_STR, CMATCH_STR, CEQUAL_STR, CDIFF_STR,
#  CHARD_CLIP_STR) = 'IDM=XH'
# def dna2cigar(s1, s2, concise=False):
# def makeCigar(reference, query, noEdgeInsertions=True):
# def cigarTuplesToOperations(tuples, includeHardClip=True):
# def softClippedOffset(offset, pairs, cigarOperations):
# def insertionOffset(offset, pairs, cigarOperations):


# Path: test/test_cigar.py
from unittest import TestCase
from pysam import CSOFT_CLIP, CHARD_CLIP, CMATCH, CINS
from dark.cigar import (
    CINS_STR, CDEL_STR, CMATCH_STR, CEQUAL_STR, CDIFF_STR,
    dna2cigar, makeCigar, cigarTuplesToOperations, softClippedOffset,
    insertionOffset)


    def testMatchOneBefore(self):
        """
        Test that an inserted base one site before a non-inserted site
        returns the correct offset.
        """
        self.assertEqual(
            (False, 10),
            insertionOffset(0,
                            ((0, None), (1, 10)),
                            (CINS, CMATCH)))

    def testMatchTwoBefore(self):
        """
        Test that an inserted base two sites before a non-inserted site
        returns the correct offset.
        """
        self.assertEqual(
            (False, 10),
            insertionOffset(0,
                            ((0, None), (1, None), (2, 10)),
                            (CINS, CINS, CMATCH)))

    def testMatchTwoBeforeWithHardClips(self):
        """
        Test that an inserted base two sites before a non-inserted site
        returns the correct offset.
        """
        self.assertEqual(
            (False, 10),

            insertionOffset(