Skip to content

Commit

Permalink
Merge pull request #200 from Geson-anko/create_project/TEMPLATE_APP_F…
Browse files Browse the repository at this point in the history
…ILE_NAME

Create project/template app file name
  • Loading branch information
Geson-anko committed Jun 1, 2022
2 parents 1972a96 + 78f5db8 commit d8a19d7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion JarvisEngine/create_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
# The absolute path to the template config file.
TEMPLATE_CONFIG_FILE_PATH = os.path.join(TEMPLATE_PROJECT_PATH, DEFAULT_CONFIG_FILE_NAME)

# The name of application file in template project.
TEMPLATE_APP_FILE_NAME = "app.py"

# The absolute path to the template application file
TEMPLATE_APP_FILE_PATH = os.path.join(TEMPLATE_PROJECT_PATH,"app.py")
TEMPLATE_APP_FILE_PATH = os.path.join(TEMPLATE_PROJECT_PATH,TEMPLATE_APP_FILE_NAME)



def create():
Expand Down
12 changes: 10 additions & 2 deletions tests/test_create_project.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
from JarvisEngine import create_project
from JarvisEngine.create_project import (
TEMPLATE_PROJECT_PATH, TEMPLATE_CONFIG_FILE_PATH, TEMPLATE_APP_FILE_PATH
TEMPLATE_PROJECT_PATH, TEMPLATE_CONFIG_FILE_PATH, TEMPLATE_APP_FILE_PATH,
TEMPLATE_APP_FILE_NAME
)
from JarvisEngine.constants import DEFAULT_CONFIG_FILE_NAME

Expand All @@ -11,16 +12,23 @@ def test_TEMPLATE_PROJECt_PATH():
os.getcwd(),"JarvisEngine", "template_project"
)


def test_TEMPLATE_APP_FILE_NAME():
assert TEMPLATE_APP_FILE_NAME == "app.py"

def test_TEMPLATE_APP_FILE_PATH():
assert os.path.isfile(TEMPLATE_APP_FILE_PATH)
assert TEMPLATE_APP_FILE_PATH == os.path.join(TEMPLATE_PROJECT_PATH, "app.py")
assert TEMPLATE_APP_FILE_PATH == os.path.join(
TEMPLATE_PROJECT_PATH, TEMPLATE_APP_FILE_NAME
)

def test_TEMPLATE_CONFIG_FILE_PATH():
assert os.path.isfile(TEMPLATE_CONFIG_FILE_PATH)
assert TEMPLATE_CONFIG_FILE_PATH == os.path.join(
TEMPLATE_PROJECT_PATH, DEFAULT_CONFIG_FILE_NAME
)


def test_make_project_folder():
creating_dir = "_test_project"
assert not os.path.exists(creating_dir)
Expand Down

0 comments on commit d8a19d7

Please sign in to comment.