

def test_backoff(self):
    key = 'new key'
    self.assertFalse(ExponentialBackoff.should_backoff(self))
    self.assertFalse(ExponentialBackoff.should_backoff(key))
    ExponentialBackoff.increment(key)
    self.assertFalse(ExponentialBackoff.should_backoff(key))
    ExponentialBackoff.increment(key)
    self.assertFalse(ExponentialBackoff.should_backoff(key))
    ExponentialBackoff.increment(key)
    self.assertTrue(ExponentialBackoff.should_backoff(key))
    ExponentialBackoff.increment(key)
    self.assertFalse(ExponentialBackoff.should_backoff(key))

dataset/ETHPy150Open dimagi/commcare-hq/corehq/util/tests/test_cache_util.py TestExponentialBackoff.test_backoff/VarMisuse@22/34 `key`->`self`