# Path: bipy/toolbox/novoindex.py
# def _build_output_file(input_file, config):
# def _build_command(input_file, novoindex_config, output_file):
# def run(input_file, novoindex_config, config):
# 
# Path: bipy/toolbox/novoalign.py
# def _build_output_file(input_file, novoalign_config, config):
# def _build_command(input_file, ref, novoalign_config):
# def run(input_file, ref, novoalign_config, config):
# 
# Path: bipy/utils.py
# def replace_suffix(filename, suffix, delim="."):
#     """ returns a filename with the suffix replaced
#     with a new suffix
#     exampoe: /path/to/test.run.sam -> /path/to/test.run.fa"""
#     dirname = os.path.dirname(filename)
#     filename = os.path.basename(filename)
#     fsplit = filename.split(delim)[:-1]
#     fsplit.append(suffix)
#     return os.path.join(dirname, delim.join(fsplit))


from bipy.toolbox import novoindex, novoalign
from bipy.utils import replace_suffix
import yaml
import sys
import unittest
import os

CONFIG_FILE = "test/novoalign/test_novoalign.yaml"


class TestNovoalign(unittest.TestCase):

    def setUp(self):
        with open(CONFIG_FILE) as in_handle:
            self.config = yaml.load(in_handle)
        self.input_files = self.config["input"]

# Path: bipy/toolbox/novoindex.py
# def _build_output_file(input_file, config):
# def _build_command(input_file, novoindex_config, output_file):
# def run(input_file, novoindex_config, config):
# 
# Path: bipy/toolbox/novoalign.py
# def _build_output_file(input_file, novoalign_config, config):
# def _build_command(input_file, ref, novoalign_config):
# def run(input_file, ref, novoalign_config, config):
# 
# Path: bipy/utils.py
# def replace_suffix(filename, suffix, delim="."):
#     """ returns a filename with the suffix replaced
#     with a new suffix
#     exampoe: /path/to/test.run.sam -> /path/to/test.run.fa"""
#     dirname = os.path.dirname(filename)
#     filename = os.path.basename(filename)
#     fsplit = filename.split(delim)[:-1]
#     fsplit.append(suffix)
#     return os.path.join(dirname, delim.join(fsplit))


# Path: test/novoalign/test_novoalign.py
from bipy.toolbox import novoindex, novoalign
from bipy.utils import replace_suffix
import yaml
import sys
import unittest
import os


CONFIG_FILE = "test/novoalign/test_novoalign.yaml"


class TestNovoalign(unittest.TestCase):

    def setUp(self):
        with open(CONFIG_FILE) as in_handle:
            self.config = yaml.load(in_handle)
        self.input_files = self.config["input"]

        self.db = os.path.basename(replace_suffix(self.config["ref"], "nix"))