Merge lp:~elopio/payclient/fix1165210-mock_factory into lp:payclient
Proposed by
Leo Arias
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Leo Arias | ||||
Approved revision: | 6 | ||||
Merged at revision: | 5 | ||||
Proposed branch: | lp:~elopio/payclient/fix1165210-mock_factory | ||||
Merge into: | lp:payclient | ||||
Diff against target: |
48 lines (+16/-15) 1 file modified
src/payclient/tests/test_client.py (+16/-15) |
||||
To merge this branch: | bzr merge lp:~elopio/payclient/fix1165210-mock_factory | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ricardo Kirkner (community) | Approve | ||
Review via email: mp+157712@code.launchpad.net |
Commit message
Use a mock for the test_factory_
To post a comment you must log in.
<pindonga> elopio, don't like the \ on l. 11 client. CreditCardReque st.__init_ _'
<pindonga> can you replace that for
<pindonga> name = 'payclient.
<pindonga> with patch(name) as mock_request:
<elopio> pindonga: I can, sure.
<pindonga> rest looks good
<elopio> pindonga: I would call it something like mock_name, though
<elopio> pindonga: and what I'm not so sure about is that mfoord said it's generally not a good idea to mock the __init__
<elopio> but I found no other way here.
<pindonga> what about mocking out the class completely?
<elopio> pindonga: that won't work, because I need to call .from_data_objects
<pindonga> k
<elopio> maybe I can ask him tomorrow to give it a look before landing.
<pindonga> sure
<pindonga> it looks good to me
<pindonga> I can comment approve and leave it up to you to do the final bit
<elopio> thanks pindonga. My mistake on friday was that I missed the return_value. It was dumb.
<pindonga> np