<reponame>fanglab/6mASCOPE<filename>SLpackage/private/pacbio/pythonpkgs/pysiv2/lib/python2.7/site-packages/pysiv2/custom/test_consolidate.py

from unittest import SkipTest
import logging

from pbcore.io import openDataSet

from pysiv2.custom.base import TestResequencingOutput
from pysiv2.io.datastore import DataStore

log = logging.getLogger(__name__)

class TestConsolidateAlignmentBam(TestResequencingOutput):
    """
    Test for behavior of BAM consolidation - only appropriate for jobs where
    this option was enabled.
    """

    def test_alignment_bam_is_single_file(self):
        """
        Test that the consolidated AlignmentSet contains a single BAM file.
        """
        if self.consolidated_alignment_file_name is None:
            raise SkipTest("No gathered AlignmentSet found")
        else:
            with openDataSet(self.consolidated_alignment_file_name) as ds:
                self.assertEqual(len(ds.toExternalFiles()), 1)
                ds.assertIndexed()

from unittest import SkipTest
import logging

from pbcore.io import openDataSet

from pysiv2.custom.base import TestResequencingOutput
from pysiv2.io.datastore import DataStore

log = logging.getLogger(__name__)

class TestConsolidateAlignmentBam(TestResequencingOutput):
    """
    Test for behavior of BAM consolidation - only appropriate for jobs where
    this option was enabled.
    """

    def test_alignment_bam_is_single_file(self):
        """
        Test that the consolidated AlignmentSet contains a single BAM file.
        """
        if self.consolidated_alignment_file_name is None:
            raise SkipTest("No gathered AlignmentSet found")
        else:
            with openDataSet(self.consolidated_alignment_file_name) as ds:
                self.assertEqual(len(ds.toExternalFiles()), 1)
                ds.assertIndexed()
Test for behavior of BAM consolidation - only appropriate for jobs where     this option was enabled. Test that the consolidated AlignmentSet contains a single BAM file.