Bladeren bron

Merge pull request #2415 from Avaiga/feature/enterprise#610-update-template-questions

Feature - Update template questions
Đỗ Trường Giang 4 maanden geleden
bovenliggende
commit
4821be5d6b

+ 10 - 10
taipy/templates/default/cookiecutter.json

@@ -1,17 +1,17 @@
 {
-    "Application root folder name": "taipy_application",
+    "Application root folder": "taipy_application",
     "Application main Python file": "main.py",
     "Application title": "Taipy Application",
-    "Page names in multi-page application?": "",
-    "Does the application use scenario management or version management?": "No",
-    "Does the application use Rest API?": "No",
-    "Do you want to initialize a new Git repository?": "No",
+    "With multi-pages?\n\tEnter the page names separated by a space": "",
+    "With scenario management?": "No",
+    "With a Rest API?": "No",
+    "With a new Git repository?": "No",
 
-    "__root_folder": "{{ cookiecutter['Application root folder name'] | replace(' ','-') }}",
+    "__root_folder": "{{ cookiecutter['Application root folder'] | replace(' ','-') }}",
     "__main_file": "{{ cookiecutter['Application main Python file'][:-3] if cookiecutter['Application main Python file'].endswith('.py') else cookiecutter['Application main Python file'] }}",
     "__application_title": "{{ cookiecutter['Application title'] }}",
-    "__pages": "{{ cookiecutter['Page names in multi-page application?'] }}",
-    "__orchestrator": "{{ cookiecutter['Does the application use scenario management or version management?'] }}",
-    "__rest": "{{ cookiecutter['Does the application use Rest API?'] }}",
-    "__git": "{{ cookiecutter['Do you want to initialize a new Git repository?']}}"
+    "__pages": "{{ cookiecutter['With multi-pages?\n\tEnter the page names separated by a space'] }}",
+    "__orchestrator": "{{ cookiecutter['With scenario management?'] }}",
+    "__rest": "{{ cookiecutter['With a Rest API?'] }}",
+    "__git": "{{ cookiecutter['With a new Git repository?']}}"
 }

+ 6 - 6
taipy/templates/sdm/cookiecutter.json

@@ -1,13 +1,13 @@
 {
-    "Application root folder name": "taipy_application",
+    "Application root folder": "taipy_application",
     "Application main Python file": "main.py",
     "Application title": "Taipy Application",
-    "Does the application use TOML Config?": "No",
-    "Do you want to initialize a new Git repository?": "No",
+    "With TOML Config?": "No",
+    "With a new Git repository?": "No",
 
-    "__root_folder": "{{ cookiecutter['Application root folder name'] | replace(' ','-') }}",
+    "__root_folder": "{{ cookiecutter['Application root folder'] | replace(' ','-') }}",
     "__main_file": "{{ cookiecutter['Application main Python file'][:-3] if cookiecutter['Application main Python file'].endswith('.py') else cookiecutter['Application main Python file'] }}",
     "__application_title": "{{ cookiecutter['Application title'] }}",
-    "__use_toml_config": "{{ cookiecutter['Does the application use TOML Config?'] }}",
-    "__git": "{{ cookiecutter['Do you want to initialize a new Git repository?']}}"
+    "__use_toml_config": "{{ cookiecutter['With TOML Config?'] }}",
+    "__git": "{{ cookiecutter['With a new Git repository?']}}"
 }

+ 13 - 13
tests/templates/test_default_template.py

@@ -51,7 +51,7 @@ def test_main_file_with_and_without_extension(tmpdir):
         output_dir=str(tmpdir),
         no_input=True,
         extra_context={
-            "Application root folder name": "foo_app",
+            "Application root folder": "foo_app",
             "Application main Python file": "app",
         },
     )
@@ -64,8 +64,8 @@ def test_with_orchestrator_service(tmpdir):
         output_dir=str(tmpdir),
         no_input=True,
         extra_context={
-            "Does the application use scenario management or version management?": "y",
-            "Does the application use Rest API?": "no",
+            "With scenario management?": "y",
+            "With a Rest API?": "no",
         },
     )
 
@@ -89,8 +89,8 @@ def test_with_rest_service(tmpdir):
         output_dir=str(tmpdir),
         no_input=True,
         extra_context={
-            "Does the application use scenario management or version management?": "n",
-            "Does the application use Rest API?": "yes",
+            "With scenario management?": "n",
+            "With a Rest API?": "yes",
         },
     )
 
@@ -112,8 +112,8 @@ def test_with_both_orchestrator_rest_services(tmpdir):
         output_dir=str(tmpdir),
         no_input=True,
         extra_context={
-            "Does the application use scenario management or version management?": "y",
-            "Does the application use Rest API?": "yes",
+            "With scenario management?": "y",
+            "With a Rest API?": "yes",
         },
     )
 
@@ -138,8 +138,8 @@ def test_multipage_gui_template(tmpdir):
         output_dir=str(tmpdir),
         no_input=True,
         extra_context={
-            "Application root folder name": "foo_app",
-            "Page names in multi-page application?": "name_1 name_2 name_3",
+            "Application root folder": "foo_app",
+            "With multi-pages?\n\tEnter the page names separated by a space": "name_1 name_2 name_3",
         },
     )
 
@@ -160,8 +160,8 @@ def test_multipage_gui_template_with_invalid_page_name(tmpdir, capfd):
             output_dir=str(tmpdir),
             no_input=True,
             extra_context={
-                "Application root folder name": "foo_app",
-                "Page names in multi-page application?": "valid_var_name 1_invalid_var_name",
+                "Application root folder": "foo_app",
+                "With multi-pages?\n\tEnter the page names separated by a space": "valid_var_name 1_invalid_var_name",
             },
         )
 
@@ -177,8 +177,8 @@ def test_with_git(tmpdir):
         output_dir=str(tmpdir),
         no_input=True,
         extra_context={
-            "Application root folder name": "foo_app",
-            "Do you want to initialize a new Git repository?": "y",
+            "Application root folder": "foo_app",
+            "With a new Git repository?": "y",
         },
     )
 

+ 6 - 6
tests/templates/test_scenario_mgt_template.py

@@ -22,10 +22,10 @@ def test_scenario_management_with_toml_config(tmpdir):
         output_dir=tmpdir,
         no_input=True,
         extra_context={
-            "Application root folder name": "foo_app",
+            "Application root folder": "foo_app",
             "Application main Python file": "main.py",
             "Application title": "bar",
-            "Does the application use TOML Config?": "yes",
+            "With TOML Config?": "yes",
         },
     )
 
@@ -54,10 +54,10 @@ def test_scenario_management_without_toml_config(tmpdir):
         output_dir=tmpdir,
         no_input=True,
         extra_context={
-            "Application root folder name": "foo_app",
+            "Application root folder": "foo_app",
             "Application main Python file": "main.py",
             "Application title": "bar",
-            "Does the application use TOML Config?": "no",
+            "With TOML Config?": "no",
         },
     )
 
@@ -85,8 +85,8 @@ def test_with_git(tmpdir):
         output_dir=str(tmpdir),
         no_input=True,
         extra_context={
-            "Application root folder name": "foo_app",
-            "Do you want to initialize a new Git repository?": "y",
+            "Application root folder": "foo_app",
+            "With a new Git repository?": "y",
         },
     )