'Make sure that the discovery HTTP failure case behaves properly'

def test_beginHTTPError(self):

    def getNextService(self, ignored):
        raise HTTPFetchingError('Unit    test')
    def test():
        try:
            self.consumer.begin('unused    in    this    test')
        except DiscoveryFailure as why:
            self.failUnless(why[0].startswith('Error    fetching'))
            self.failIf((why[0].find('Unit    test') == (-1)))
        else:
            self.fail('Expected    DiscoveryFailure')
    self.withDummyDiscovery(test, getNextService)
