Skip to content

clrmethod working for python 2 #494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 16, 2017
Prev Previous commit
Next Next commit
Fix test docstrings
  • Loading branch information
Rickard Holmberg committed Jun 15, 2017
commit 6d736dfb5986b515e6ba9f1f66514712265af425
8 changes: 5 additions & 3 deletions src/tests/test_clrmethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def Y(self):
return self._x * 2

def test_set_and_get_property_from_py():
"""Test usage of CLR defined reference types."""
"""Test setting and getting clr-accessible properties from python."""
t = ExampleClrClass()
assert t.X == 3
assert t.Y == 3 * 2
Expand All @@ -35,7 +35,7 @@ def test_set_and_get_property_from_py():
assert t.Y == 4 * 2

def test_set_and_get_property_from_clr():
"""Test usage of CLR defined reference types."""
"""Test setting and getting clr-accessible properties from the clr."""
t = ExampleClrClass()
assert t.GetType().GetProperty("X").GetValue(t) == 3
assert t.GetType().GetProperty("Y").GetValue(t) == 3 * 2
Expand All @@ -45,7 +45,7 @@ def test_set_and_get_property_from_clr():


def test_set_and_get_property_from_clr_and_py():
"""Test usage of CLR defined reference types."""
"""Test setting and getting clr-accessible properties alternatingly from the clr and from python."""
t = ExampleClrClass()
assert t.GetType().GetProperty("X").GetValue(t) == 3
assert t.GetType().GetProperty("Y").GetValue(t) == 3 * 2
Expand All @@ -63,9 +63,11 @@ def test_set_and_get_property_from_clr_and_py():
assert t.Y == 5 * 2

def test_method_invocation_from_py():
"""Test calling a clr-accessible method from python."""
t = ExampleClrClass()
assert t.test(41) == 41*2

def test_method_invocation_from_clr():
"""Test calling a clr-accessible method from the clr."""
t = ExampleClrClass()
assert t.GetType().GetMethod("test").Invoke(t, [37]) == 37*2