copied sample api test from OT/scripts/demo/python