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
2 changed files
with
59 additions
and
3 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,46 @@ | ||
""" | ||
@brief test log(time=2s) | ||
""" | ||
|
||
import sys | ||
import os | ||
import unittest | ||
import re | ||
|
||
|
||
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 | ||
|
||
from src.pyquickhelper import fLOG | ||
from src.pyquickhelper.ipythonhelper.magic_class_example import MagicClassExample | ||
|
||
|
||
class TestMagicCommands (unittest.TestCase): | ||
|
||
def test_magic_commands(self): | ||
fLOG( | ||
__file__, | ||
self._testMethodName, | ||
OutputPrint=__name__ == "__main__") | ||
|
||
mg = MagicClassExample() | ||
mg.add_context({"MagicClassExample": MagicClassExample}) | ||
cmd = "MagicClassExample -f text" | ||
fLOG("**", cmd) | ||
res = mg.htmlhelp(cmd) | ||
fLOG(res) | ||
assert "@NB(example of a magic command)" | ||
|
||
|
||
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