Code review comment for lp:~julian-edwards/maas/periodic-lease-upload-pserv

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Thanks for the comments!

I tried your fixture suggestion in the last test but I can't get it to work. Can you take a look please?

Take this branch and apply this diff:
http://paste.ubuntu.com/8095590/

I get this output:
======================================================================
FAIL: provisioningserver.tests.test_lease_upload_service.TestPeriodicImageDownloadService.test_upload_is_initiated
----------------------------------------------------------------------
_StringException: Failed expectation: {{{
File "/home/ed/canonical/maas/sandbox/src/maastesting/crochet.py", line 101, in __checkResults
    fail_count, Equals(0), "Unfired and/or unhandled "
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 447, in expectThat
    postfix_content="MismatchError: " + str(mismatch_error)
MismatchError: 0 != 1: Unfired and/or unhandled EventualResult(s); see test details.
}}}

Unfired/unhandled EventualResult #1: {{{
*** EventualResult has not fired:
<crochet._eventloop.EventualResult object at 0x7f9e58fcfbd0>
*** It was connected to a Deferred:
<Deferred at 0x7f9e58fd35a8>
}}}

traceback-1: {{{
Traceback (most recent call last):
AssertionError: Forced Test Failure
}}}

Traceback (most recent call last):
  File "/home/ed/canonical/maas/sandbox/src/provisioningserver/tests/test_lease_upload_service.py", line 214, in test_upload_is_initiated
    MockCalledOnceWith(uuid=uuid, mappings=mappings))
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 406, in assertThat
    raise mismatch_error
MismatchError: Expected to be called once. Called 0 times.

-------------------- >> begin captured logging << --------------------
twisted: INFO: AMPTestProtocol#1 connection established (HOST:<twisted.test.iosim.FakeAddress object at 0x7f9e58fc64d0> PEER:<twisted.test.iosim.FakeAddress object at 0x7f9e58fc6510>)
twisted: INFO: ClusterClient connection established (HOST:<twisted.test.iosim.FakeAddress object at 0x7f9e58fc6550> PEER:<twisted.test.iosim.FakeAddress object at 0x7f9e58fc6590>)
--------------------- >> end captured logging << ---------------------

« Back to merge proposal