使用pytest 编写测试方法,参数为mocker; 实例化Product 对象; 使用mocker.patch() 方法对get_product_status_by_id 方法进行Mock,并设置返回值; 调用并断言.
確定! 回上一頁