def create(doc_type: str, name: str): """ Creates a slide template using the passed name :param doc_type: 'presentation', 'document', or the name of a custom template :param name: Display name, will be standardized to snakecase and lowercase for use in the file name :return: """ doc_type = doc_type.lower().strip() create_template(doc_type, name)
def test_custom_template(): expect_content = "some content" _replace_local_template("document", expect_content) create_template("document", "My Document") source = _get_generated_source("document", "my_document") assert source == expect_content
def test_create_document(): create_template("document", "My Document") assert_dir_trees_are_equal(INPUT_DOCUMENT_SOURCES_FOLDER, GENERATED_DOCUMENT_SOURCES_FOLDER)
def test_create_presentation(): create_template("presentation", "My Presentation") assert_dir_trees_are_equal(INPUT_PRESENTATION_SOURCES_FOLDER, GENERATED_PRESENTATION_SOURCES_FOLDER)
def before_each(): regenerate_generated_init_project() os.chdir(GENERATED_PROJECT_FOLDER) create_template("presentation", "My Presentation") create_template("document", "My Document") yield
def _generate_document(): create_template("document", "My Document")
def _generate_presentation(): create_template("presentation", "My Presentation")