# Path: riboSeed/ribo.py
# def main(args=None):
#     """ given a riboSeed cmd, import that submodule, and run the main function
#     """
#     # this args thing looks stupid, but conda requires a main funtion
#     # that does not have required args.  Sigh...
#     if args is None:
#         args = sys.argv
#     assert ((sys.version_info[0] == 3) and (sys.version_info[1] >= 5)), \
#         "Must use python3.5 or higher!"
#     if len(args) == 1 or "-h" in args[1]:
#         print("\n".join(helpmsg))
#         return 0
#     if "-v" in args[1]:
#         print(riboSeed.__version__)
#         return 0
#     modules_dict = {
#         "run": "run_riboSeed",
#         "scan": "riboScan",
#         "select": "riboSelect",
#         "snag": "riboSnag",
#         "seed": "riboSeed",
#         "sketch": "riboSketch",
#         "stack": "riboStack",
#         "score": "riboScore",
#         "sim": "riboSim",
#         "swap": "riboSwap",
#         "spec": "riboSpec",
#         "structure": "riboStructure",
#         "config": "make_riboSeed_config",
#         "try": "riboTry"}
#     if args[1] not in modules_dict.keys():
#         print("Error:" + args[1] +
#               " is not an available program. See the list below:\n")
#         print("\n".join(helpmsg))
#         return 1
#     modname = args[1]
#     this_module = importlib.import_module("riboSeed." + modules_dict[modname])
# 
#     these_args = this_module.get_args()
#     return this_module.main(these_args)


import sys
import logging
import shutil
import os
import unittest
import time
from unittest.mock import Mock
from riboSeed.ribo import main


@unittest.skipIf((sys.version_info[0] != 3) or (sys.version_info[1] < 5),
                 "Subprocess.call among other things wont run if tried " +
                 " with less than python 3.5")
class riboTestCase(unittest.TestCase):
    """ tests for riboSeed.py
    """
    def setUp(self):
        self.startTime = time.time()

    def test_main_return_1_invalid(self):
        args = ["ribo", "notavalidarg"]
        self.assertEqual(main(args), 1)

    def test_main_return_0_version(self):
        args = ["ribo", "-v"]
        self.assertEqual(main(args), 0)

    def test_main_return_0_help(self):
        args = ["ribo"]
        self.assertEqual(main(args), 0)

    def tearDown(self):
        """
        """
        pass


if __name__ == '__main__':

# Path: riboSeed/ribo.py
# def main(args=None):
#     """ given a riboSeed cmd, import that submodule, and run the main function
#     """
#     # this args thing looks stupid, but conda requires a main funtion
#     # that does not have required args.  Sigh...
#     if args is None:
#         args = sys.argv
#     assert ((sys.version_info[0] == 3) and (sys.version_info[1] >= 5)), \
#         "Must use python3.5 or higher!"
#     if len(args) == 1 or "-h" in args[1]:
#         print("\n".join(helpmsg))
#         return 0
#     if "-v" in args[1]:
#         print(riboSeed.__version__)
#         return 0
#     modules_dict = {
#         "run": "run_riboSeed",
#         "scan": "riboScan",
#         "select": "riboSelect",
#         "snag": "riboSnag",
#         "seed": "riboSeed",
#         "sketch": "riboSketch",
#         "stack": "riboStack",
#         "score": "riboScore",
#         "sim": "riboSim",
#         "swap": "riboSwap",
#         "spec": "riboSpec",
#         "structure": "riboStructure",
#         "config": "make_riboSeed_config",
#         "try": "riboTry"}
#     if args[1] not in modules_dict.keys():
#         print("Error:" + args[1] +
#               " is not an available program. See the list below:\n")
#         print("\n".join(helpmsg))
#         return 1
#     modname = args[1]
#     this_module = importlib.import_module("riboSeed." + modules_dict[modname])
# 
#     these_args = this_module.get_args()
#     return this_module.main(these_args)


# Path: tests/test_ribo.py
import sys
import logging
import shutil
import os
import unittest
import time
from unittest.mock import Mock
from riboSeed.ribo import main



@unittest.skipIf((sys.version_info[0] != 3) or (sys.version_info[1] < 5),
                 "Subprocess.call among other things wont run if tried " +
                 " with less than python 3.5")
class riboTestCase(unittest.TestCase):
    """ tests for riboSeed.py
    """
    def setUp(self):
        self.startTime = time.time()

    def test_main_return_1_invalid(self):
        args = ["ribo", "notavalidarg"]
        self.assertEqual(main(args), 1)

    def test_main_return_0_version(self):
        args = ["ribo", "-v"]
        self.assertEqual(main(args), 0)

    def test_main_return_0_help(self):
        args = ["ribo"]
        self.assertEqual(main(args), 0)

    def tearDown(self):
        """
        """
        pass


if __name__ == '__main__':

    unittest.main()