public void TestPyTupleInvalidAppend() { using (Py.GIL()) { PyObject s = new PyString("foo"); var t = new PyTuple(); Assert.Throws <PythonException>(() => t.Concat(s)); } }
public void TestPyTupleValidAppend() { var t0 = new PyTuple(); var t = new PyTuple(); t.Concat(t0); Assert.IsNotNull(t); Assert.IsInstanceOf(typeof(PyTuple), t); }
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); }