Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create project/add constants #188

Merged
merged 2 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions JarvisEngine/create_project.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
import os
from .core import parsers
from .constants import ENGINE_PATH,DEFAULT_CONFIG_FILE_NAME

# The absolute path to the template project
TEMPLATE_PROJECT_PATH = os.path.join(ENGINE_PATH, "template_project")

# The absolute path to the template config file.
TEMPLATE_CONFIG_FILE_PATH = os.path.join(TEMPLATE_PROJECT_PATH, DEFAULT_CONFIG_FILE_NAME)

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


def create():
"""create JE project."""
Expand Down
22 changes: 22 additions & 0 deletions tests/test_create_project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os
from JarvisEngine import create_project
from JarvisEngine.create_project import (
TEMPLATE_PROJECT_PATH, TEMPLATE_CONFIG_FILE_PATH, TEMPLATE_APP_FILE_PATH
)
from JarvisEngine.constants import DEFAULT_CONFIG_FILE_NAME

def test_TEMPLATE_PROJECt_PATH():
assert os.path.isdir(TEMPLATE_PROJECT_PATH)
assert TEMPLATE_PROJECT_PATH == os.path.join(
os.getcwd(),"JarvisEngine", "template_project"
)

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")

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
)