# Path: crumbs/utils/bin_utils.py
# BIN_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..',
#                                        'bin'))


import unittest
import os.path
from tempfile import NamedTemporaryFile
from subprocess import check_output, CalledProcessError
from crumbs.utils.bin_utils import BIN_DIR


# pylint: disable=R0201
# pylint: disable=R0904

FASTA = ">seq1\natctagtc\n>seq2\natctagtc\n>seq3\natctagtc\n"
QUAL = ">seq1\n30 30 30 30 30 30 30 30\n>seq2\n30 30 30 30 30 30 30 30\n"
QUAL += ">seq3\n30 30 30 30 30 30 30 30\n"
FASTQ = '@seq1\natcgt\n+\n?????\n@seq2\natcgt\n+\n?????\n@seq3\natcgt\n+\n'
FASTQ += '?????\n'


def _make_fhand(content=None):
    'It makes temporary fhands'
    if content is None:
        content = ''
    fhand = NamedTemporaryFile()
    fhand.write(content)
    fhand.flush()
    return fhand


class FastaQualToFastqTest(unittest.TestCase):
    'It test the convert_format binary'

    def test_fastaqual_to_fasta(self):
        'It test fastaqual to fastq binary'
        fasta_fhand = _make_fhand(FASTA)
        qual_fhand = _make_fhand(QUAL)


# Path: crumbs/utils/bin_utils.py
# BIN_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..',
#                                        'bin'))


# Path: test/seq/test_convert_format.py
import unittest
import os.path
from tempfile import NamedTemporaryFile
from subprocess import check_output, CalledProcessError
from crumbs.utils.bin_utils import BIN_DIR



# pylint: disable=R0201
# pylint: disable=R0904

FASTA = ">seq1\natctagtc\n>seq2\natctagtc\n>seq3\natctagtc\n"
QUAL = ">seq1\n30 30 30 30 30 30 30 30\n>seq2\n30 30 30 30 30 30 30 30\n"
QUAL += ">seq3\n30 30 30 30 30 30 30 30\n"
FASTQ = '@seq1\natcgt\n+\n?????\n@seq2\natcgt\n+\n?????\n@seq3\natcgt\n+\n'
FASTQ += '?????\n'


def _make_fhand(content=None):
    'It makes temporary fhands'
    if content is None:
        content = ''
    fhand = NamedTemporaryFile()
    fhand.write(content)
    fhand.flush()
    return fhand


class FastaQualToFastqTest(unittest.TestCase):
    'It test the convert_format binary'

    def test_fastaqual_to_fasta(self):
        'It test fastaqual to fastq binary'
        fasta_fhand = _make_fhand(FASTA)
        qual_fhand = _make_fhand(QUAL)


        seqio_bin = os.path.join(BIN_DIR, 'fastaqual_to_fastq')