modify unittest to patch return value correctly