Skip to content

Commit

Permalink
Add PrimitiveIntConversion test
Browse files Browse the repository at this point in the history
  • Loading branch information
C-SELLERS committed Feb 16, 2021
1 parent f59335f commit bd94e49
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/embed_tests/TestConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,17 @@ public void RawPyObjectProxy()
var proxiedHandle = pyObjectProxy.GetAttr("Handle").As<IntPtr>();
Assert.AreEqual(pyObject.Handle, proxiedHandle);
}

[Test]
public void PrimitiveIntConversion()
{
decimal value = 10;
var pyValue = value.ToPython();

// Try to convert python value to int
var testInt = pyValue.As<int>();
Assert.AreEqual(testInt , 10);
}

}
}

0 comments on commit bd94e49

Please sign in to comment.