This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
203 additions
and
17 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
67 changes: 67 additions & 0 deletions
67
_unittests/ut_notebooks/test_LONG_2A_notebook_3A_enonce.py
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,67 @@ | ||
""" | ||
@brief test log(time=620s) | ||
notebook test | ||
""" | ||
|
||
import sys | ||
import os | ||
import unittest | ||
|
||
|
||
try: | ||
import src | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
".."))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import src | ||
|
||
try: | ||
import pyquickhelper as skip_ | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
"..", | ||
"..", | ||
"pyquickhelper", | ||
"src"))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import pyquickhelper as skip_ | ||
|
||
from pyquickhelper.loghelper import fLOG | ||
from pyquickhelper.pycode import get_temp_folder, add_missing_development_version | ||
|
||
|
||
class TestNotebookRunner2a_3A_enonce (unittest.TestCase): | ||
|
||
def setUp(self): | ||
add_missing_development_version(["pymyinstall", "pyensae", "pymmails"], | ||
__file__, hide=True) | ||
|
||
def test_notebook_runner_enonce(self): | ||
fLOG( | ||
__file__, | ||
self._testMethodName, | ||
OutputPrint=__name__ == "__main__") | ||
from src.ensae_teaching_cs.automation.notebook_test_helper import ls_notebooks, execute_notebooks, unittest_raise_exception_notebook, clean_function_1a | ||
temp = get_temp_folder(__file__, "temp_notebook2a_3A_enonce") | ||
keepnote = ls_notebooks("td2a") | ||
assert len(keepnote) > 0 | ||
res = execute_notebooks( | ||
temp, keepnote, lambda i, n: "_3A" in n and "enonce" in n, | ||
clean_function=clean_function_1a) | ||
unittest_raise_exception_notebook(res, fLOG) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
66 changes: 66 additions & 0 deletions
66
_unittests/ut_notebooks/test_LONG_2A_notebook_3B_correction.py
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,66 @@ | ||
""" | ||
@brief test log(time=620s) | ||
notebook test | ||
""" | ||
|
||
import sys | ||
import os | ||
import unittest | ||
|
||
|
||
try: | ||
import src | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
".."))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import src | ||
|
||
try: | ||
import pyquickhelper as skip_ | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
"..", | ||
"..", | ||
"pyquickhelper", | ||
"src"))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import pyquickhelper as skip_ | ||
|
||
from pyquickhelper.loghelper import fLOG | ||
from pyquickhelper.pycode import get_temp_folder, add_missing_development_version | ||
|
||
|
||
class TestNotebookRunner2a_3B_correction (unittest.TestCase): | ||
|
||
def setUp(self): | ||
add_missing_development_version(["pymyinstall", "pyensae", "pymmails"], | ||
__file__, hide=True) | ||
|
||
def test_notebook_runner_correction(self): | ||
fLOG( | ||
__file__, | ||
self._testMethodName, | ||
OutputPrint=__name__ == "__main__") | ||
from src.ensae_teaching_cs.automation.notebook_test_helper import ls_notebooks, execute_notebooks, unittest_raise_exception_notebook, clean_function_1a | ||
temp = get_temp_folder(__file__, "temp_notebook2a_3B_correction") | ||
keepnote = ls_notebooks("td2a") | ||
assert len(keepnote) > 0 | ||
res = execute_notebooks( | ||
temp, keepnote, lambda i, n: "_3B" in n and "correction" in n, | ||
clean_function=clean_function_1a) | ||
unittest_raise_exception_notebook(res, fLOG) | ||
|
||
if __name__ == "__main__": | ||
unittest.main() |
67 changes: 67 additions & 0 deletions
67
_unittests/ut_notebooks/test_LONG_2A_notebook_3B_enonce.py
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,67 @@ | ||
""" | ||
@brief test log(time=620s) | ||
notebook test | ||
""" | ||
|
||
import sys | ||
import os | ||
import unittest | ||
|
||
|
||
try: | ||
import src | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
".."))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import src | ||
|
||
try: | ||
import pyquickhelper as skip_ | ||
except ImportError: | ||
path = os.path.normpath( | ||
os.path.abspath( | ||
os.path.join( | ||
os.path.split(__file__)[0], | ||
"..", | ||
"..", | ||
"..", | ||
"pyquickhelper", | ||
"src"))) | ||
if path not in sys.path: | ||
sys.path.append(path) | ||
import pyquickhelper as skip_ | ||
|
||
from pyquickhelper.loghelper import fLOG | ||
from pyquickhelper.pycode import get_temp_folder, add_missing_development_version | ||
|
||
|
||
class TestNotebookRunner2a_3B_enonce (unittest.TestCase): | ||
|
||
def setUp(self): | ||
add_missing_development_version(["pymyinstall", "pyensae", "pymmails"], | ||
__file__, hide=True) | ||
|
||
def test_notebook_runner_enonce(self): | ||
fLOG( | ||
__file__, | ||
self._testMethodName, | ||
OutputPrint=__name__ == "__main__") | ||
from src.ensae_teaching_cs.automation.notebook_test_helper import ls_notebooks, execute_notebooks, unittest_raise_exception_notebook, clean_function_1a | ||
temp = get_temp_folder(__file__, "temp_notebook2a_3B_enonce") | ||
keepnote = ls_notebooks("td2a") | ||
assert len(keepnote) > 0 | ||
res = execute_notebooks( | ||
temp, keepnote, lambda i, n: "_3B" in n and "enonce" in n, | ||
clean_function=clean_function_1a) | ||
unittest_raise_exception_notebook(res, fLOG) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |