public void TestPyTupleCtorArray() { var a = new PyObject[] { new PyInt(1), new PyString("Foo") }; var t = new PyTuple(a); Assert.AreEqual(2, t.Length()); }
public void TestPyTupleCtorArrayPyIntEmpty() { var a = new PyInt[] { }; var t = new PyTuple(a); Assert.AreEqual(0, t.Length()); }
public void TestPyTupleCtorEmptyArray() { var a = new PyObject[] { }; var t = new PyTuple(a); Assert.AreEqual(0, t.Length()); }
public void TestPyTupleEmpty() { using (Py.GIL()) { var t = new PyTuple(); Assert.AreEqual(0, t.Length()); } }
public void TestPyTupleInvalidAppend() { PyObject s = new PyString("foo"); var t = new PyTuple(); var ex = Assert.Throws <PythonException>(() => t.Concat(s)); StringAssert.StartsWith("can only concatenate tuple", ex.Message); Assert.AreEqual(0, t.Length()); Assert.IsEmpty(t); }