Merge lp:~nataliabidart/ubuntuone-dev-tools/add-recorder into lp:ubuntuone-dev-tools
| Status: | Rejected |
|---|---|
| Rejected by: | Natalia Bidart on 2012-07-27 |
| Proposed branch: | lp:~nataliabidart/ubuntuone-dev-tools/add-recorder |
| Merge into: | lp:ubuntuone-dev-tools |
| Diff against target: |
249 lines (+223/-0) 2 files modified
ubuntuone/devtools/testcases/__init__.py (+101/-0) ubuntuone/devtools/testcases/tests/test_recorder.py (+122/-0) |
| To merge this branch: | bzr merge lp:~nataliabidart/ubuntuone-dev-tools/add-recorder |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| dobey (community) | 2012-03-23 | Needs Information on 2012-03-26 | |
| Alejandro J. Cura (community) | Approve on 2012-03-23 | ||
|
Review via email:
|
|||
Commit Message
- Provide a Recorder class, useful for building Fakes, and a class decorator
to record calls to existent class' methods.
| dobey (dobey) wrote : | # |
| dobey (dobey) wrote : | # |
My first thought is, can we move this to a new module under testing/ instead? I think it might also be good to move the current skip decorators out of the testcases/__init__ and into a new module under testing/ instead as well, and having this be a new module there instead of another huge block of code in testcases/__init__ would be a good start to that end.
What do you think?
| Natalia Bidart (nataliabidart) wrote : | # |
> My first thought is, can we move this to a new module under testing/ instead?
> I think it might also be good to move the current skip decorators out of the
> testcases/__init__ and into a new module under testing/ instead as well, and
> having this be a new module there instead of another huge block of code in
> testcases/__init__ would be a good start to that end.
>
> What do you think?
I think it makes sense, a proposal can be:
ubuntuone.
| dobey (dobey) wrote : | # |
So I just had a brilliant idea for some naming here.
ubuntuone.
CallRecorder for the current "Recorder" class name.
@record_calls for the decorator name, if we really need it at all? Do you have an example of how it would be useful in tests only, vs having to define a new wrapper class in the tests which this would wrap anyway? It seems not very useful to have, after thinking about it. Also, the way it works can create problems with class hierarchy when multiple inheritance is used in code (particularly thinking about how TwistedTestCase stuff works as an example, and the problems we've had in the past with it).
Also, do we want the assert methods to be on the BaseTestCase, or do we want a new CallRecorderTes
Unmerged revisions
- 63. By Natalia Bidart on 2012-03-23
-
- Attaching bug #963265.
- 62. By Natalia Bidart on 2012-03-23
-
- Making the _next_result attribute to be a dict so it supports different
results for every method. - 61. By Natalia Bidart on 2012-03-23
-
- Prefer using class_ instead of klass to conform pep8 better.
- 60. By Natalia Bidart on 2012-03-23
-
Forgotten file.
- 59. By Natalia Bidart on 2012-03-23
-
- Provide a Recorder class, useful for building Fakes, and a class decorator
to record existent classes.

Set to Work in Progress as it's not clear this is 'finished' yet. Also, please commit --fixes for the bug # before setting back to Needs Review. Thanks.