bmuller / txyam

Yet Another Memcached (YAM) client for Python Twisted
Other
10 stars 5 forks source link

Refactor for adding tests #5

Closed weykent closed 10 years ago

weykent commented 10 years ago

Firstly, this does make the codebase pyflakes/pep8-compliant, but I can remove that commit if it's too invasive of a change.

Secondly, this refactors the memcached code to create 'requests' which are then issued against MemCacheProtocol instances. This made writing tests easier.

Thirdly, this adds a bunch of tests, as the codebase is a bit lacking in that regard.

bmuller commented 10 years ago

Thanks for these @weykent - I really do appreciate you going through all of this effort. With 37de87a6164b919965be973f3dabf19ffcdd22d6, however, I ended up going with something more along the lines of the Twisted memcache tests. The _issueRequest wrapper just seemed like a different route than the strategies that seem to be most common in the Twisted core.

I also added in consistent hashing, which is something else that needed to be added (thanks for pointing that out in a previous PR), and updated the code to make pyflakes/pep8 happy (see the lint section of the Makefile).

Thanks again - and let me know if there's anything else that you see in the lib that could use some fixing.

Thanks!