# Path: alfpy/utils/seqrecords.py
# class SeqRecords:
#     def __init__(self, id_list=None, seq_list=None):
#     def add(self, seqid, seq):
#     def fasta(self, wrap=70):
#     def length_list(self):
#     def __iter__(self):
#     def __len__(self):
#     def __repr__(self):
# def read_fasta(handle):
# def main():


import unittest
from alfpy.utils import seqrecords
from . import utils

    def _validate_seqrecords(self, rec):
        self.assertEqual(rec.id_list, self.ID_LIST)
        self.assertEqual(rec.seq_list, self.SEQ_LIST)
        self.assertEqual(rec.length_list, [len(s) for s in self.SEQ_LIST])
        self.assertEqual(rec.count, len(self.SEQ_LIST))

    def test_SeqRecords_init(self):
        rec = seqrecords.SeqRecords(
            id_list=self.ID_LIST, seq_list=self.SEQ_LIST)
        self._validate_seqrecords(rec)

    def test_SeqRecords_add(self):
        rec = seqrecords.SeqRecords()
        for i in range(len(self.ID_LIST)):
            rec.add(self.ID_LIST[i], self.SEQ_LIST[i])
        self._validate_seqrecords(rec)

    def test_SeqRecords_len(self):
        rec = seqrecords.SeqRecords(
            id_list=self.ID_LIST, seq_list=self.SEQ_LIST)
        self.assertEqual(len(rec), 4)

    def test_read_fasta(self):
        fh = open(utils.get_test_data('pep.fa'))
        rec = seqrecords.read_fasta(fh)
        fh.close()
        self._validate_seqrecords(rec)

    def test_fasta(self):

# Path: alfpy/utils/seqrecords.py
# class SeqRecords:
#     def __init__(self, id_list=None, seq_list=None):
#     def add(self, seqid, seq):
#     def fasta(self, wrap=70):
#     def length_list(self):
#     def __iter__(self):
#     def __len__(self):
#     def __repr__(self):
# def read_fasta(handle):
# def main():


# Path: tests/test_seqrecords.py
import unittest
from alfpy.utils import seqrecords
from . import utils


    def _validate_seqrecords(self, rec):
        self.assertEqual(rec.id_list, self.ID_LIST)
        self.assertEqual(rec.seq_list, self.SEQ_LIST)
        self.assertEqual(rec.length_list, [len(s) for s in self.SEQ_LIST])
        self.assertEqual(rec.count, len(self.SEQ_LIST))

    def test_SeqRecords_init(self):
        rec = seqrecords.SeqRecords(
            id_list=self.ID_LIST, seq_list=self.SEQ_LIST)
        self._validate_seqrecords(rec)

    def test_SeqRecords_add(self):
        rec = seqrecords.SeqRecords()
        for i in range(len(self.ID_LIST)):
            rec.add(self.ID_LIST[i], self.SEQ_LIST[i])
        self._validate_seqrecords(rec)

    def test_SeqRecords_len(self):
        rec = seqrecords.SeqRecords(
            id_list=self.ID_LIST, seq_list=self.SEQ_LIST)
        self.assertEqual(len(rec), 4)

    def test_read_fasta(self):
        fh = open(utils.get_test_data('pep.fa'))
        rec = seqrecords.read_fasta(fh)
        fh.close()
        self._validate_seqrecords(rec)

    def test_fasta(self):

        rec = seqrecords.SeqRecords(