()
| 120 | |
| 121 | #[test] |
| 122 | fn new_with_two_args() { |
| 123 | let gil = Python::acquire_gil(); |
| 124 | let py = gil.python(); |
| 125 | let typeobj = py.get_type::<NewWithTwoArgs>(); |
| 126 | let obj = typeobj |
| 127 | .call(py, (10, 20), None) |
| 128 | .unwrap() |
| 129 | .cast_into::<NewWithTwoArgs>(py) |
| 130 | .unwrap(); |
| 131 | assert_eq!(*obj._data1(py), 10); |
| 132 | assert_eq!(*obj._data2(py), 20); |
| 133 | } |
| 134 | |
| 135 | struct TestDropCall { |
| 136 | drop_called: Arc<AtomicBool>, |