Open HenryLeongStat opened 5 years ago
Only functions with name def testXXXX
will be considered as tests.
As a convention, let us do this for Julia and possibly all other language modules
def testIntToJulia(self):
RUN: var=int_value
RUN: %use Julia
%get var
RUN type of var
ASSERT type of var
RUN value of var
ASSERT value of var
# restore to sos kernel
RUN %use SoS
def testIntFromJulia(self):
RUN %use Julia
RUN var = int
RUN %use SoS\n%get var --from Julia
RUN dict var
ASSERT values of var
Note that
dict
makes it easier to check multiple values.Edit: forget about var1
, var2
, let us use a test for a single value, like
testInt
testLongInt
testFloat
testDouble
testString
testStringWithBackSlash
$ python test_julia_kernel.py
/Users/manchongleong/anaconda/lib/python3.6/site-packages/jupyter_client/manager.py:72: DeprecationWarning: KernelManager._kernel_name_changed is deprecated in traitlets 4.1: use @observe and @unobserve instead.
def _kernel_name_changed(self, name, old, new):
./Users/manchongleong/anaconda/lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
return f(*args, **kwds)
...............
----------------------------------------------------------------------
Ran 16 tests in 34.512s
OK
That should be more than 4 tests. Not sure what is going on.