Visitar URL original
Change as by koubaa · Pull Request #1118 · pythonnet/pythonnet · GitHub
Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test case
  • Loading branch information
koubaa committed Apr 17, 2020
commit f2ea4956a9af30c558cccf04336c702e966e6149
10 changes: 10 additions & 0 deletions src/embed_tests/TestConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,15 @@ public void RawPyObjectProxy()
var proxiedHandle = pyObjectProxy.GetAttr("Handle").As<IntPtr>();
Assert.AreEqual(pyObject.Handle, proxiedHandle);
}

[Test]
public void ConvertToObject()
{
object pyInt = new PyInt(12).As<object>();
Assert.AreSame(pyInt.GetType(), typeof(int));

object pyString = new PyString("hello").As<object>();
Assert.AreSame(pyString.GetType(), typeof(string));
}
}
}