def test_should_generate_sphinx_build_command_per_project_properties(self): self.project.set_property("sphinx_config_path", "docs/") self.project.set_property("sphinx_source_dir", "docs/") self.project.set_property("sphinx_output_dir", "docs/_build/") self.project.set_property("sphinx_doc_builder", 'JSONx') sphinx_build_command = get_sphinx_build_command(self.project) self.assertEqual(sphinx_build_command, "sphinx-build -b JSONx basedir/docs/ basedir/docs/_build/")
def test_should_generate_sphinx_build_command_builder_dir(self): self.project.set_property("sphinx_config_path", "docs/") self.project.set_property("sphinx_source_dir", "docs/") self.project.set_property("sphinx_output_dir", "docs/_build/") self.project.set_property("sphinx_doc_builder", ['JSONx', 'pdf']) sphinx_build_command = get_sphinx_build_command(self.project, Mock(), 'JSONx') self.assertEqual(sphinx_build_command, ["sphinx", "-b", "JSONx", "basedir/docs/", "basedir/docs/_build/JSONx"])
def test_should_generate_sphinx_build_command_per_project_properties(self): self.project.set_property("sphinx_config_path", "docs/") self.project.set_property("sphinx_source_dir", "docs/") self.project.set_property("sphinx_output_dir", "docs/_build/") self.project.set_property("sphinx_doc_builder", 'JSONx') sphinx_build_command = get_sphinx_build_command(self.project) self.assertEqual( sphinx_build_command, "sphinx-build -b JSONx basedir/docs/ basedir/docs/_build/")
def test_should_generate_sphinx_build_command_verbose(self): self.project.set_property("sphinx_config_path", "docs/") self.project.set_property("sphinx_source_dir", "docs/") self.project.set_property("sphinx_output_dir", "docs/_build/") self.project.set_property("sphinx_doc_builder", 'JSONx') self.project.set_property("verbose", True) sphinx_build_command = get_sphinx_build_command(self.project, Mock(), 'JSONx') self.assertEqual(sphinx_build_command, ["sphinx", "-b", "JSONx", "-v", nc("basedir/docs/"), nc("basedir/docs/_build/")])
def test_should_generate_sphinx_build_command_per_project_properties(self): project = Project('basedir') project.set_property("sphinx_builder", "html") project.set_property("sphinx_config_path", "docs/") project.set_property("sphinx_source_dir", "docs/") project.set_property("sphinx_output_dir", "docs/_build/") sphinx_build_command = get_sphinx_build_command(project) self.assertEqual(sphinx_build_command, "sphinx-build -b html -c basedir/docs/ basedir/docs/ basedir/docs/_build/")
def test_should_generate_sphinx_build_command_builder_dir(self): self.project.set_property("sphinx_config_path", "docs/") self.project.set_property("sphinx_source_dir", "docs/") self.project.set_property("sphinx_output_dir", "docs/_build/") self.project.set_property("sphinx_doc_builder", ['JSONx', 'pdf']) sphinx_build_command = get_sphinx_build_command( self.project, Mock(), 'JSONx') self.assertEqual(sphinx_build_command, [ "sphinx", "-b", "JSONx", "basedir/docs/", "basedir/docs/_build/JSONx" ])
def test_should_generate_sphinx_build_command_builder_dir(self): self.project.set_property("sphinx_config_path", "docs/") self.project.set_property("sphinx_source_dir", "docs/") self.project.set_property("sphinx_output_dir", "docs/_build/") self.project.set_property("sphinx_doc_builder", ["JSONx", "pdf"]) sphinx_build_command = get_sphinx_build_command( self.project, Mock(), "JSONx") self.assertEqual(sphinx_build_command, [ ANY, "-b", "JSONx", np(jp(self.project.basedir, "docs/")), np(jp(self.project.basedir, "docs/_build/JSONx")) ])
def test_should_generate_sphinx_build_command_per_project_properties(self): project = Project('basedir') project.set_property("sphinx_builder", "html") project.set_property("sphinx_config_path", "docs/") project.set_property("sphinx_source_dir", "docs/") project.set_property("sphinx_output_dir", "docs/_build/") sphinx_build_command = get_sphinx_build_command(project) self.assertEqual( sphinx_build_command, "sphinx-build -b html -c basedir/docs/ basedir/docs/ basedir/docs/_build/" )
def test_should_generate_sphinx_build_command_debug(self): self.project.set_property("sphinx_config_path", "docs/") self.project.set_property("sphinx_source_dir", "docs/") self.project.set_property("sphinx_output_dir", "docs/_build/") self.project.set_property("sphinx_doc_builder", 'JSONx') logger = Mock() logger.threshold = 1 logger.DEBUG = 1 sphinx_build_command = get_sphinx_build_command(self.project, logger, 'JSONx') self.assertEqual(sphinx_build_command, ["sphinx", "-b", "JSONx", "-vvvv", "basedir/docs/", "basedir/docs/_build/"])
def test_should_generate_sphinx_build_command_verbose(self): self.project.set_property("sphinx_config_path", "docs/") self.project.set_property("sphinx_source_dir", "docs/") self.project.set_property("sphinx_output_dir", "docs/_build/") self.project.set_property("sphinx_doc_builder", 'JSONx') self.project.set_property("verbose", True) sphinx_build_command = get_sphinx_build_command( self.project, Mock(), 'JSONx') self.assertEqual(sphinx_build_command, [ "sphinx", "-b", "JSONx", "-v", nc("basedir/docs/"), nc("basedir/docs/_build/") ])
def test_should_generate_sphinx_build_command_debug(self): self.project.set_property("sphinx_config_path", "docs/") self.project.set_property("sphinx_source_dir", "docs/") self.project.set_property("sphinx_output_dir", "docs/_build/") self.project.set_property("sphinx_doc_builder", 'JSONx') logger = Mock() logger.threshold = 1 logger.DEBUG = 1 sphinx_build_command = get_sphinx_build_command( self.project, logger, 'JSONx') self.assertEqual(sphinx_build_command, [ "sphinx", "-b", "JSONx", "-vvvv", "basedir/docs/", "basedir/docs/_build/" ])
def test_should_generate_sphinx_build_command_debug(self): self.project.set_property("sphinx_config_path", "docs/") self.project.set_property("sphinx_source_dir", "docs/") self.project.set_property("sphinx_output_dir", "docs/_build/") self.project.set_property("sphinx_doc_builder", "JSONx") logger = Mock() logger.level = 1 logger.DEBUG = 1 sphinx_build_command = get_sphinx_build_command( self.project, logger, "JSONx") self.assertEqual(sphinx_build_command, [ ANY, "-b", "JSONx", "-vvvv", np(jp(self.project.basedir, "docs/")), np(jp(self.project.basedir, "docs/_build/")) ])