Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
kokimame committed Jan 31, 2018
2 parents 69c7304 + b605cd4 commit 9bb3aff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 48 deletions.
File renamed without changes.
51 changes: 3 additions & 48 deletions tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,7 @@
from .gui_testing import joytan_running


def run_with_message(callback, *args, before_msg=None, after_msg=None, **kargs):
if before_msg:
print(before_msg)
callback(*args, **kargs)
if after_msg:
print(after_msg)


def test_entrylist():
print("\n== Test_entrylist")

with joytan_running() as mw:
# Initially entrylist shows one helper list item telling basic usages
assert super(EntryList, mw.entrylist).count() == 1
Expand Down Expand Up @@ -53,24 +43,17 @@ def test_entrylist():
mw.entrylist.remove_entry_all()
assert mw.entrylist.count() == 0

print("Done test_entrylist")


def test_open():
print("\n== Test_open")

# Sample Joytan EntryList file to open
test_jel = 'tests/assets/ja_en.jel.csv'
assert os.path.exists(test_jel), 'Test file %s not found' % test_jel
test_csv = 'tests/assets/ja_en.csv'
assert os.path.exists(test_csv), 'Test file %s not found' % test_csv

with joytan_running() as mw:
from gui.open import on_open
on_open(mw, file=test_jel)
on_open(mw, file=test_csv)

assert mw.entrylist.count() == 4
# We no longer save TTS information in .jel.csv file,
# but we should do so by the way like appending these info to the CSV.
# assert mw.entrylist.get_config('undefined') == []

# Atop key is in ewkeys
assert 'atop' in mw.entrylist.get_config('ewkeys')
Expand All @@ -80,31 +63,3 @@ def test_open():
# Number of ewkeys: atop + def-n * (ex-n-m + 1)
n_keys = 1 + ndef * (nex + 1)
assert n_keys == len(mw.entrylist.get_config('ewkeys'))

print("Done test_open")

# This test is failing on Travis CI environment
# possibly because we're skipping configuring eSpeak
#
# def test_audiodialog():
# print("== Test_audiodialog")
#
# # Sample Joytan EntryList file to open
# test_jel = 'tests/assets/ja_en.jel.csv'
# assert os.path.exists(test_jel), 'Test file %s not found' % test_jel
#
# with joytan_running() as mw:
# from gui.open import on_open
# on_open(mw, file=test_jel)
#
# from gui import audiodialog
# ad = audiodialog.AudioDialog(mw)
#
# destdir = os.path.join(mw.projectbase(), "audio")
# if os.path.isdir(destdir):
# run_with_message(shutil.rmtree, destdir, before_msg='delete destdir')
#
# run_with_message(ad._on_create, before_msg='create audiobook', after_msg='audiobook created')
# ad.thread.wait()
#
# print("Done test_audiodialog")

0 comments on commit 9bb3aff

Please sign in to comment.