-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: More testing files for LMEDS
- Loading branch information
Showing
11 changed files
with
232 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
''' | ||
Created on May 16, 2016 | ||
@author: tmahrt | ||
''' | ||
|
||
import os | ||
from os.path import join | ||
import sys | ||
|
||
cwd = os.path.dirname(os.path.realpath(__file__)) | ||
_root = os.path.split(cwd)[0] | ||
sys.path.append(_root) | ||
|
||
from lmeds import rpt_main | ||
|
||
leafFolder = "lmeds_demo" | ||
sequenceFile = "sequence.txt" | ||
languageFile = "english.txt" | ||
disableRefresh = False | ||
audioExtList = [".ogg", ".mp3"] | ||
|
||
survey = rpt_main.WebSurvey(leafFolder, sequenceFile, languageFile, | ||
disableRefresh, audioExtList=audioExtList) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,14 @@ | ||
''' | ||
Created on Apr 29, 2016 | ||
@author: Tim | ||
''' | ||
|
||
import os | ||
from os.path import join | ||
import sys | ||
|
||
cwd = os.path.dirname(os.path.realpath(__file__)) | ||
_root = os.path.split(cwd)[0] | ||
sys.path.append(_root) | ||
|
||
from lmeds import rpt_main | ||
|
||
leafFolder = "lmeds_demo" | ||
sequenceFile = "sequence.txt" | ||
languageFile = "english.txt" | ||
disableRefresh = False | ||
audioExtList = [".ogg", ".mp3"] | ||
|
||
survey = rpt_main.WebSurvey(leafFolder, sequenceFile, languageFile, | ||
disableRefresh, audioExtList=audioExtList) | ||
|
||
for i in range(survey.testSequence.getNumPages()): | ||
page = survey.testSequence.getPage(i) | ||
survey.buildPage(i, "", page, "no_name", survey.testSequence, | ||
survey.sourceCGIFN) | ||
''' | ||
Created on Apr 29, 2016 | ||
@author: Tim | ||
''' | ||
|
||
import base_demo | ||
|
||
survey = base_demo.survey | ||
|
||
for i in range(survey.testSequence.getNumPages()): | ||
page = survey.testSequence.getPage(i) | ||
survey.buildPage(i, "", page, "no_name", survey.testSequence, | ||
survey.sourceCGIFN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
''' | ||
Created on Apr 29, 2016 | ||
@author: tmahrt | ||
Runs integration tests | ||
The examples were all written as scripts. They weren't meant to be | ||
imported or run from other code. So here, the integration test is just | ||
importing the scripts, which causes them to execute. If the code completes | ||
with no errors, then the code is at least able to complete. | ||
Testing whether or not the code actually did what it is supposed to is | ||
another issue and will require some refactoring. | ||
''' | ||
|
||
import unittest | ||
import os | ||
import sys | ||
|
||
cwd = os.path.dirname(os.path.realpath(__file__)) | ||
_root = os.path.split(cwd)[0] | ||
sys.path.append(_root) | ||
os.chdir(_root) | ||
|
||
class UserScriptIntegrationTests(unittest.TestCase): | ||
"""Integration tests""" | ||
|
||
def test_gen_dictionary(self): | ||
"""Running 'lmeds_virtual_demo'""" | ||
import user_script_gen_dictionary | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
''' | ||
Created on Apr 29, 2016 | ||
@author: tmahrt | ||
Runs integration tests | ||
The examples were all written as scripts. They weren't meant to be | ||
imported or run from other code. So here, the integration test is just | ||
importing the scripts, which causes them to execute. If the code completes | ||
with no errors, then the code is at least able to complete. | ||
Testing whether or not the code actually did what it is supposed to is | ||
another issue and will require some refactoring. | ||
''' | ||
|
||
import unittest | ||
import os | ||
import sys | ||
|
||
cwd = os.path.dirname(os.path.realpath(__file__)) | ||
_root = os.path.split(cwd)[0] | ||
sys.path.append(_root) | ||
os.chdir(_root) | ||
|
||
class UserScriptIntegrationTests2(unittest.TestCase): | ||
"""Integration tests""" | ||
def test_get_duration(self): | ||
"""Running 'get_duration_demo'""" | ||
import user_script_get_duration | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
''' | ||
Created on Apr 29, 2016 | ||
@author: tmahrt | ||
Runs integration tests | ||
The examples were all written as scripts. They weren't meant to be | ||
imported or run from other code. So here, the integration test is just | ||
importing the scripts, which causes them to execute. If the code completes | ||
with no errors, then the code is at least able to complete. | ||
Testing whether or not the code actually did what it is supposed to is | ||
another issue and will require some refactoring. | ||
''' | ||
|
||
import unittest | ||
import os | ||
import sys | ||
|
||
cwd = os.path.dirname(os.path.realpath(__file__)) | ||
_root = os.path.split(cwd)[0] | ||
sys.path.append(_root) | ||
os.chdir(_root) | ||
|
||
class UserScriptIntegrationTests3(unittest.TestCase): | ||
"""Integration tests""" | ||
def test_post_process(self): | ||
"""Running 'get_duration_demo'""" | ||
import user_script_post_process | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
''' | ||
Created on Apr 29, 2016 | ||
@author: tmahrt | ||
Runs integration tests | ||
The examples were all written as scripts. They weren't meant to be | ||
imported or run from other code. So here, the integration test is just | ||
importing the scripts, which causes them to execute. If the code completes | ||
with no errors, then the code is at least able to complete. | ||
Testing whether or not the code actually did what it is supposed to is | ||
another issue and will require some refactoring. | ||
''' | ||
|
||
import unittest | ||
import os | ||
import sys | ||
|
||
cwd = os.path.dirname(os.path.realpath(__file__)) | ||
_root = os.path.split(cwd)[0] | ||
sys.path.append(_root) | ||
os.chdir(_root) | ||
|
||
|
||
class UserScriptIntegrationTests4(unittest.TestCase): | ||
"""Integration tests""" | ||
def test_sequence_check(self): | ||
"""Running 'get_duration_demo'""" | ||
import user_script_sequence_check | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
''' | ||
Created on Apr 29, 2016 | ||
@author: Tim | ||
''' | ||
|
||
import base_demo | ||
from lmeds.user_scripts import generate_language_dictionary | ||
|
||
generate_language_dictionary.generateLanguageDictionary("update", "LMEDS_DEMO", | ||
"sequence.txt", | ||
"english.txt" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
''' | ||
Created on Apr 29, 2016 | ||
@author: Tim | ||
''' | ||
|
||
from os.path import join | ||
|
||
import base_demo | ||
from lmeds.user_scripts import get_test_duration | ||
from lmeds.io import sequence | ||
from lmeds.utilities import constants | ||
|
||
survey = base_demo.survey | ||
|
||
rootPath = join(constants.rootDir, "tests", "LMEDS_Demo") | ||
tmpSequence = sequence.TestSequence(None, join(rootPath, "sequence.txt")) | ||
fullPath = join(rootPath, "output", tmpSequence.sequenceTitle) | ||
get_test_duration.printTestDuration(fullPath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
''' | ||
Created on Apr 29, 2016 | ||
@author: Tim | ||
''' | ||
|
||
import base_demo | ||
from lmeds.user_scripts import post_process_results | ||
|
||
post_process_results.postProcessResults("LMEDS_Demo", "sequence.txt", True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
''' | ||
Created on Apr 29, 2016 | ||
@author: Tim | ||
''' | ||
|
||
import base_demo | ||
from lmeds.user_scripts import sequence_check | ||
|
||
survey = base_demo.survey | ||
|
||
sequence_check.checkSequenceFile(survey) |