Пример #1
0
 public void TestPyTupleInvalidAppend()
 {
     using (Py.GIL())
     {
         PyObject s = new PyString("foo");
         var      t = new PyTuple();
         Assert.Throws <PythonException>(() => t.Concat(s));
     }
 }
Пример #2
0
        public void TestPyTupleValidAppend()
        {
            var t0 = new PyTuple();
            var t  = new PyTuple();

            t.Concat(t0);

            Assert.IsNotNull(t);
            Assert.IsInstanceOf(typeof(PyTuple), t);
        }
Пример #3
0
        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);
        }