honzajavorek/redis-collections — pull request #27 by peter-conalgo (2014-12-11 15:32:32+00:00)
Title: Correct list.insert() and add list.append() functions

Found an issue where LSET would be called in `list.insert(-1, val)` depending on the contents of the list. Because LSET replaces and cannot insert values, doing `list.insert(-1, val) on a list of length one or more would corrupt the contents of the list.

New test case `test_lset_issue()` fails on older versions of the code and demonstrates the issue when the list is length one.

In fact, I don't see any way to correctly support insert into a redis list, except at the head (LPUSH), so I removed support for insert at any `index > 0`.

Added `list.append()` using RPUSH call. `list.insert(-1, val)` can be used for LPUSH.