|
|
@ -32,7 +32,8 @@ def test_extract_index(): |
|
|
|
|
|
|
|
|
|
|
|
# check the results |
|
|
|
# check the results |
|
|
|
fname = os.path.join( dname, "index.txt" ) |
|
|
|
fname = os.path.join( dname, "index.txt" ) |
|
|
|
assert open( fname, "r", encoding="utf-8" ).read() == buf |
|
|
|
with open( fname, "r", encoding="utf-8" ) as fp: |
|
|
|
|
|
|
|
assert fp.read() == buf |
|
|
|
|
|
|
|
|
|
|
|
# run the test |
|
|
|
# run the test |
|
|
|
for_each_easlrb_version( do_test ) |
|
|
|
for_each_easlrb_version( do_test ) |
|
|
@ -61,13 +62,17 @@ def test_extract_content(): |
|
|
|
|
|
|
|
|
|
|
|
# check the results |
|
|
|
# check the results |
|
|
|
fname2 = os.path.join( dname, "targets.txt" ) |
|
|
|
fname2 = os.path.join( dname, "targets.txt" ) |
|
|
|
assert open( fname2, "r", encoding="utf-8" ).read() == targets_buf |
|
|
|
with open( fname2, "r", encoding="utf-8" ) as fp: |
|
|
|
|
|
|
|
assert fp.read() == targets_buf |
|
|
|
fname2 = os.path.join( dname, "chapters.txt" ) |
|
|
|
fname2 = os.path.join( dname, "chapters.txt" ) |
|
|
|
assert open( fname2, "r", encoding="utf-8" ).read() == chapters_buf |
|
|
|
with open( fname2, "r", encoding="utf-8" ) as fp: |
|
|
|
|
|
|
|
assert fp.read() == chapters_buf |
|
|
|
fname2 = os.path.join( dname, "footnotes.txt" ) |
|
|
|
fname2 = os.path.join( dname, "footnotes.txt" ) |
|
|
|
assert open( fname2, "r", encoding="utf-8" ).read() == footnotes_buf |
|
|
|
with open( fname2, "r", encoding="utf-8" ) as fp: |
|
|
|
|
|
|
|
assert fp.read() == footnotes_buf |
|
|
|
fname2 = os.path.join( dname, "vo-notes.txt" ) |
|
|
|
fname2 = os.path.join( dname, "vo-notes.txt" ) |
|
|
|
assert open( fname2, "r", encoding="utf-8" ).read() == vo_notes_buf |
|
|
|
with open( fname2, "r", encoding="utf-8" ) as fp: |
|
|
|
|
|
|
|
assert fp.read() == vo_notes_buf |
|
|
|
|
|
|
|
|
|
|
|
# run the test |
|
|
|
# run the test |
|
|
|
for_each_easlrb_version( do_test ) |
|
|
|
for_each_easlrb_version( do_test ) |
|
|
@ -99,15 +104,20 @@ def test_extract_all(): |
|
|
|
|
|
|
|
|
|
|
|
# check the results |
|
|
|
# check the results |
|
|
|
fname2 = os.path.join( dname, "index.json" ) |
|
|
|
fname2 = os.path.join( dname, "index.json" ) |
|
|
|
assert open( fname2, "r", encoding="utf-8" ).read() == index_buf |
|
|
|
with open( fname2, "r", encoding="utf-8" ) as fp: |
|
|
|
|
|
|
|
assert fp.read() == index_buf |
|
|
|
fname2 = os.path.join( dname, "targets.json" ) |
|
|
|
fname2 = os.path.join( dname, "targets.json" ) |
|
|
|
assert open( fname2, "r", encoding="utf-8" ).read() == targets_buf |
|
|
|
with open( fname2, "r", encoding="utf-8" ) as fp: |
|
|
|
|
|
|
|
assert fp.read() == targets_buf |
|
|
|
fname2 = os.path.join( dname, "chapters.json" ) |
|
|
|
fname2 = os.path.join( dname, "chapters.json" ) |
|
|
|
assert open( fname2, "r", encoding="utf-8" ).read() == chapters_buf |
|
|
|
with open( fname2, "r", encoding="utf-8" ) as fp: |
|
|
|
|
|
|
|
assert fp.read() == chapters_buf |
|
|
|
fname2 = os.path.join( dname, "footnotes.json" ) |
|
|
|
fname2 = os.path.join( dname, "footnotes.json" ) |
|
|
|
assert open( fname2, "r", encoding="utf-8" ).read() == footnotes_buf |
|
|
|
with open( fname2, "r", encoding="utf-8" ) as fp: |
|
|
|
|
|
|
|
assert fp.read() == footnotes_buf |
|
|
|
fname2 = os.path.join( dname, "vo-notes.json" ) |
|
|
|
fname2 = os.path.join( dname, "vo-notes.json" ) |
|
|
|
assert open( fname2, "r", encoding="utf-8" ).read() == vo_notes_buf |
|
|
|
with open( fname2, "r", encoding="utf-8" ) as fp: |
|
|
|
|
|
|
|
assert fp.read() == vo_notes_buf |
|
|
|
|
|
|
|
|
|
|
|
# run the test |
|
|
|
# run the test |
|
|
|
for_each_easlrb_version( do_test ) |
|
|
|
for_each_easlrb_version( do_test ) |
|
|
|