# Path: anoisetools/scripts/truncate.py
# def build_parser(subparsers):
# def trim(barcode, length, in_handle, out_handle):
#     def inner(sequences, pattern):
# def main(parsed):


from cStringIO import StringIO
from anoisetools.scripts import truncate
import unittest


class TrimTestCase(unittest.TestCase):

    def setUp(self):
        self.input = StringIO('''>GYUL5KN02IY0NH qclip: 5..519
CGATCTAAGTTCATAACCCATCCAAGGAATGGAGGTTCTTTCTGATGCTTTTTGTCTGGTGTAGTGAATCCCCAGCTCAATAGGTGAGCT''')
        self.barcode = 'GCGATCT'
        self.output = StringIO()

    @property
    def _value(self):
        return self.output.getvalue()

    def test_barcode_removed(self):
        truncate.trim(self.barcode, 20, self.input, self.output)
        self.assertFalse(self._value.splitlines()[1].startswith(self.barcode))

    def test_expected_full(self):

# Path: anoisetools/scripts/truncate.py
# def build_parser(subparsers):
# def trim(barcode, length, in_handle, out_handle):
#     def inner(sequences, pattern):
# def main(parsed):


# Path: anoisetools/test/scripts/test_truncate.py
from cStringIO import StringIO
from anoisetools.scripts import truncate
import unittest



class TrimTestCase(unittest.TestCase):

    def setUp(self):
        self.input = StringIO('''>GYUL5KN02IY0NH qclip: 5..519
CGATCTAAGTTCATAACCCATCCAAGGAATGGAGGTTCTTTCTGATGCTTTTTGTCTGGTGTAGTGAATCCCCAGCTCAATAGGTGAGCT''')
        self.barcode = 'GCGATCT'
        self.output = StringIO()

    @property
    def _value(self):
        return self.output.getvalue()

    def test_barcode_removed(self):
        truncate.trim(self.barcode, 20, self.input, self.output)
        self.assertFalse(self._value.splitlines()[1].startswith(self.barcode))

    def test_expected_full(self):

        truncate.trim(self.barcode, 20, self.input, self.output)