def test_key_added(self): test_data = [ {'a': 'b'}, {'a': 'b'} ] p = AutoIncrement('counter') p.bind(test_data) for i in p: self.assertIn('counter', i)
def test_key_increment_start(self): test_data = [ {'a': 'b'}, {'a': 'b'} ] p = AutoIncrement('counter', start_value=2) p.bind(test_data) c = 2 for i in p: c += 1 self.assertIn('counter', i) self.assertEquals(i['counter'], c)
def test_key_increment_interval(self): test_data = [ {'a': 'b'}, {'a': 'b'} ] p = AutoIncrement('counter', interval=2) p.bind(test_data) c = 0 for i in p: c += 2 self.assertIn('counter', i) self.assertEquals(i['counter'], c)