For #20562, rewrite python api unit tests for follow to fit python api unit test conventions.