我正在尝试在django单元测试中模拟googleapiclient.discovery,我查看了这个post,它展示了如何模拟googleapiclient.discovery,所以我尝试了以下内容@mock.patch("myapp.views.googleapiclient.discovery")
def test_get_instances(self, mock_discovery):这给出了一个"Module n
我正在使用Robolectric并尝试创建GoogleApiClient的阴影对象,但失败了。Shadow类的方法永远不会被调用。GoogleApiClient是接口--这会是个问题吗?有没有办法“隐藏”GoogleApiClient接口(或在测试中模拟GoogleApiClient )?实施:public class ShadowGoogleApiClient {
public