0
有沒有一種方法來捕捉,而不必模擬傳遞到函數中patch
裝飾以下邏輯:配置返回值的模擬與裝飾只有
@patch('boto3.client')
def test_playing_with_saml(self, boto3_client):
boto3_client.return_value.assume_role_with_saml = lambda *args, **kwargs: ('foo', 'bar')
self.assertEqual(playing_with_saml(), 'expected')
我不知道你可以像這樣鏈接它!乾杯。 – RNikoopour