Skip to content
This repository has been archived by the owner on Jul 23, 2022. It is now read-only.

Commit

Permalink
to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Jun 14, 2018
1 parent 02134a3 commit 122c917
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions _unittests/ut_runtime/test_dynamic_cs.py
Expand Up @@ -35,6 +35,7 @@ def test_src(self):
self.assertFalse(src is None)

def test_pythonnet(self):
print("test_pythonnet")
clr.AddReference("System")
from System import String
s = String("example")
Expand All @@ -45,11 +46,14 @@ def test_pythonnet(self):
d = Dictionary[String, String]()
d["un"] = "1"
self.assertEqual(d.Count, 1)
print("test_pythonnet")

def test_add_reference_system(self):
print("test_add_reference_system")
clr.AddReference("System")

def test_pythonnet_array(self):
print("test_pythonnet_array")
clr.AddReference("System")
from System import IntPtr, Array, Double, Int64
self.assertTrue(Double is not None)
Expand All @@ -67,14 +71,18 @@ def test_pythonnet_array(self):
# Marshal.Copy(ar, ar2, 0, len(ar2))
# except TypeError as e:
# warnings.warn(str(e))
print("test_pythonnet_array")

def test_create_cs_function(self):
print("test_create_cs_function")
code = "public static double SquareX(double x) {return x*x ; }"
f = create_cs_function("SquareX", code)
r = f(2.0)
self.assertEqual(r, 4)
print("test_create_cs_function")

def test_magic_cs(self):
print("test_magic_cs")
cm = CsMagics()
code = "public static double SquareX(double x) {return x*x ; }"
code = """
Expand Down Expand Up @@ -136,6 +144,7 @@ def test_magic_cs(self):
self.assertEqual(res, exp)
err = err.getvalue().split('\n')[0]
self.assertEqual(res, exp)
print("test_magic_cs")


if __name__ == "__main__":
Expand Down

0 comments on commit 122c917

Please sign in to comment.