Remove use of deprecated method in Python sample and make easier to test
Merge pull request #926 from rcordovano/release-3.1.1

Remove use of deprecated method in Python sample and make easier to test