Convert python test case old to new Api

Hello

I have converted python test case old to new API.

thanks.