def test_ignore_errors_really_ignores(self): d1 = txstathat.txStatHat(b'').count(self.TEST_COUNT, 42) d1.addCallback(lambda s: self.assertEqual(s, self.MSG_NO_EZKEY)) txstathat.API_URI = b'http://invalid.invalid' d2 = self.sh.count(b'does not matter') d2.addCallback(lambda rv: self.assertIsNone(rv)) return defer.DeferredList([d1, d2])
def test_check_api_result(self): d = txstathat.txStatHat(b'', ignore_errors=False) \ .count(self.TEST_COUNT, 42) return self.assertFailure(d, txstathat.txStatHatApiException)
def setUp(self): self.sh = txstathat.txStatHat(EZ_KEY) # some tests tinker with the API URI self.old_API_URI = txstathat.API_URI