Esempio n. 1
0
class CMDReaderTest(unittest.TestCase):

    def setUp(self):
        logging.basicConfig()
        self.logger = logging.getLogger(self.__module__ + "." + self.__class__.__name__)
        self.logger.setLevel(logging.DEBUG)
        self.cr = CMDReader()
        self.current_dir = os.getcwd()
        base_directory = os.path.split(__file__)[0]
        base_directory = os.path.abspath(os.path.join(base_directory, '..',
                                                      '..', '..'))
        os.chdir(base_directory)

    def tearDown(self):
        os.chdir(self.current_dir)

    def test_check_args_exception(self):  # Tests if the Exception is correctly raised
        targs = TestArgs('.', 1234, 2, 'DEBUG')
        with self.assertRaises(SystemExit):
            self.cr.read_cmd(targs.cmdline())

    def test_check_args(self):  # Tests if no Exception is raised
        targs = TestArgs('test/test_files/scenario_test/scenario.txt', 1234, 2, 'DEBUG')
        self.cr.read_cmd(targs.cmdline())

    def test_doc_files(self):
        self.cr.write_main_options_to_doc(path="test.rst")
        self.cr.write_smac_options_to_doc(path="test.rst")
        self.cr.write_scenario_options_to_doc(path="test.rst")
        os.remove("./test.rst")
Esempio n. 2
0
# If false, no module index is generated.
#texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False

# Show init as well as moduledoc
autoclass_content = 'both'

cmd_reader = CMDReader()
cmd_reader.write_main_options_to_doc()
cmd_reader.write_smac_options_to_doc()
cmd_reader.write_scenario_options_to_doc()

# Sphinx-gallery configuration.
sphinx_gallery_conf = {
    # disable mini galleries clustered by the used functions
    'backreferences_dir': False,
    # path to the examples
    'examples_dirs': '../examples',
    # path where to save gallery generated examples
    'gallery_dirs': 'examples',
    # compile execute examples in the examples dir
    'filename_pattern': '.*example.py$|.*tutorial.py$',
    # TODO: fix back/forward references for the examples.
}