Python: fixed DeprecationWarnings in unit tests