Skip to content

Commit

Permalink
fix(test): add test cases for train in api
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc committed Sep 23, 2019
1 parent af05c72 commit c009dcc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/test_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from stagesepx.api import cut, classify, one_step
from stagesepx.api import cut, classify, one_step, train
from stagesepx.reporter import Reporter

PROJECT_PATH = os.path.dirname(os.path.dirname(__file__))
Expand All @@ -12,10 +12,13 @@ def test_one_step():


def test_cut_and_classify():
# --- cutter ---
# test cut
res, data_home = cut(VIDEO_PATH)

# --- classify ---
# test train
train(data_home, "hello.pkl")

# test classify
classify_result = classify(VIDEO_PATH, data_home)

# --- draw ---
Expand Down
3 changes: 3 additions & 0 deletions test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ def test_cli():
subprocess.check_call(['stagesepx', 'cut', VIDEO_PATH])
subprocess.check_call(['stagesepx', 'cut', VIDEO_PATH, 'output'])

logger.info('checking train ...')
subprocess.check_call(['stagesepx', 'train', 'output', 'model.pkl'])

logger.info('checking classifier ...')
subprocess.check_call(['stagesepx', 'classify', VIDEO_PATH, 'output'])
shutil.rmtree('output')

0 comments on commit c009dcc

Please sign in to comment.