Skip to content

Commit

Permalink
test already initialized project
Browse files Browse the repository at this point in the history
  • Loading branch information
vinicvaz committed Jul 22, 2024
1 parent daa81ee commit 1dd35de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/vame/initialize_project/new.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def init_new_project(
project: str,
videos: List[str],
poses_estimations: List[str],
working_directory: str = None,
working_directory: str = '.',
videotype: str = '.mp4'
) -> str:
"""Creates a new VAME project with the given parameters.
Expand All @@ -60,9 +60,6 @@ def init_new_project(
d = str(month[0:3]+str(day))
date = dt.today().strftime('%Y-%m-%d')

if working_directory is None:
working_directory = '.'

wd = Path(working_directory).resolve()
project_name = '{pn}-{date}'.format(pn=project, date=d+'-'+str(year))

Expand Down
9 changes: 9 additions & 0 deletions tests/test_initialize_project.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path
from vame.util.auxiliary import read_config
from vame import init_new_project

def test_project_config_exists(setup_project_not_aligned_data):
"""
Expand All @@ -15,3 +16,11 @@ def test_project_name_config(setup_project_not_aligned_data):
config_values = read_config(config)
assert config_values['Project'] == setup_project_not_aligned_data['project_name']


def test_existing_project(setup_project_not_aligned_data):
init_new_project(
project=setup_project_not_aligned_data['project_name'],
videos=setup_project_not_aligned_data['videos'],
poses_estimations=setup_project_not_aligned_data['videos'],
working_directory='./tests'
)

0 comments on commit 1dd35de

Please sign in to comment.