def test_sets_undefined_key(self): a = [ {'a': 1, 'b': 1} ] p = Ensure({'c': 2}) p.bind(a) for i in p: self.assertIn('c', i)
def test_does_not_overwrite_existing_key(self): a = [ {'a': 1, 'b': 1} ] p = Ensure({'a': 2}) p.bind(a) for i in p: self.assertIn('a', i) self.assertEquals(i['a'], 1)