lp:~free.ekanayaka/landscape-client/amp-cleanup-7
- Get this branch:
- bzr branch lp:~free.ekanayaka/landscape-client/amp-cleanup-7
Branch merges
- Chris Glass (community): Approve
- Geoff Teale (community): Approve
-
Diff: 311 lines (+84/-131)6 files modifiedlandscape/broker/tests/helpers.py (+16/-33)
landscape/package/tests/test_changer.py (+19/-24)
landscape/package/tests/test_releaseupgrader.py (+10/-14)
landscape/package/tests/test_reporter.py (+31/-43)
landscape/package/tests/test_taskhandler.py (+5/-9)
landscape/tests/helpers.py (+3/-8)
Branch information
Recent revisions
- 660. By Free Ekanayaka
-
Merge testable-amp [f=1169102] [r=ack,tealeg] [a=Free Ekanayaka]
This is a first step towards having synchronous tests for AMP-related code:- Use composition vs inheritance, so MethodCallServe
rProtocol has now become
MethodCallReceiver and MethodCallClien tProtocol has become MethodCallSender.
They don't inherit from the base AMP protocol anymore, this will let us mock
the AMP protocol itself later on.- Put in place temporary workarounds (marked with "XXX") for the few breakages
that such refactoring causes. These will be cleaned up in a follow-up branch.- Changed most of the tests in l/lib/tests/
test_amp. py to be synchronous and not
use the real Twisted reactor. This is done by faking the transport, so we can
simulate a connection rather than use real Unix sockets. These methods don't
need to return deferreds anymore in order to perform their assertions, as
they can trust that everything happens synchronously.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:~landscape/landscape-client/trunk