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 (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 << ---------------------
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: paste.ubuntu. com/8095590/
http://
I get this output: ======= ======= ======= ======= ======= ======= ======= ======= ======= ver.tests. test_lease_ upload_ service. TestPeriodicIma geDownloadServi ce.test_ upload_ is_initiated ------- ------- ------- ------- ------- ------- ------- ------- ------- ed/canonical/ maas/sandbox/ src/maastesting /crochet. py", line 101, in __checkResults python2. 7/dist- packages/ testtools/ testcase. py", line 447, in expectThat content= "MismatchError: " + str(mismatch_error)
=======
FAIL: provisioningser
-------
_StringException: Failed expectation: {{{
File "/home/
fail_count, Equals(0), "Unfired and/or unhandled "
File "/usr/lib/
postfix_
MismatchError: 0 != 1: Unfired and/or unhandled EventualResult(s); see test details.
}}}
Unfired/unhandled EventualResult #1: {{{ _eventloop. EventualResult object at 0x7f9e58fcfbd0>
*** EventualResult has not fired:
<crochet.
*** 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): ed/canonical/ maas/sandbox/ src/provisionin gserver/ tests/test_ lease_upload_ service. py", line 214, in test_upload_ is_initiated nceWith( uuid=uuid, mappings=mappings)) python2. 7/dist- packages/ testtools/ testcase. py", line 406, in assertThat
File "/home/
MockCalledO
File "/usr/lib/
raise mismatch_error
MismatchError: Expected to be called once. Called 0 times.
------- ------- ------ >> begin captured logging << ------- ------- ------ twisted. test.iosim. FakeAddress object at 0x7f9e58fc64d0> PEER:<twisted. test.iosim. FakeAddress object at 0x7f9e58fc6510>) twisted. test.iosim. FakeAddress object at 0x7f9e58fc6550> PEER:<twisted. test.iosim. FakeAddress object at 0x7f9e58fc6590>) ------- ------- >> end captured logging << ------- ------- -------
twisted: INFO: AMPTestProtocol#1 connection established (HOST:<
twisted: INFO: ClusterClient connection established (HOST:<
-------