()
| 343 | |
| 344 | #[test] |
| 345 | fn static_method_with_args() { |
| 346 | let gil = Python::acquire_gil(); |
| 347 | let py = gil.python(); |
| 348 | |
| 349 | assert_eq!(StaticMethodWithArgs::method(py, 1234).unwrap(), "0x4d2"); |
| 350 | let d = PyDict::new(py); |
| 351 | d.set_item(py, "C", py.get_type::<StaticMethodWithArgs>()) |
| 352 | .unwrap(); |
| 353 | py.run("assert C.method(1337) == '0x539'", None, Some(&d)) |
| 354 | .unwrap(); |
| 355 | } |
| 356 | |
| 357 | py_class!(class StaticData |py| { |
| 358 | static VAL1 = 123; |