Start exposing Redis types in the Plugin storage interface #12

Merged
merged 5 commits into from Mar 23, 2013

Conversation

Projects
None yet
3 participants
Contributor

unbracketed commented Mar 17, 2013

No description provided.

@yml yml commented on the diff Mar 18, 2013

botbotme_plugins/base.py
@@ -81,7 +88,7 @@ def __init__(self, *args, **kwargs):
# Cmd is an old-style class, super doesn't work
# super(DummyApp, self).__init__(*args, **kwargs)
self.responses = []
- self.storage = {}
+ self.storage = fakeredis.FakeStrictRedis()
@yml

yml Mar 18, 2013

Owner

This may be not the right place to add this storage realted logic. We are trying to move all sotrage related info from the Line to the app. The Plugin can be used for the indirection.

@unbracketed

unbracketed Mar 18, 2013

Contributor

We are trying to move all sotrage related info from the Line to the app

Isn't this already the case?

@ipmb ipmb and 1 other commented on an outdated diff Mar 18, 2013

botbotme_plugins/tests/test_storage.py
+
+
+def test_retrieve_nonexistent_key():
+ assert(bp.retrieve('nobody_home') is None)
+
+
+def test_store_and_retrieve():
+ bp.store('michael_jacksons_pet_monkey', 'banana')
+ assert(bp.retrieve('michael_jacksons_pet_monkey') == 'banana')
+
+
+def test_incr():
+ #key doesn't exist yet
+ assert(bp.incr('lindsey_lohan') == 1)
+ #incr key with current value of 1
+ assert(bp.incr('lindsey_lohan') == 2)
@ipmb

ipmb Mar 18, 2013

Owner

👎 for test data 😉

@unbracketed

unbracketed Mar 18, 2013

Contributor

I'll change the names :)
...or is there something else I should be doing here?

@ipmb

ipmb Mar 19, 2013

Owner

I'm just kidding, it's your bikeshed to paint. 🎪

@unbracketed unbracketed added a commit that referenced this pull request Mar 23, 2013

@unbracketed unbracketed Merge pull request #12 from lincolnloop/features/better-storage
Start exposing Redis types in the Plugin storage interface
9e73d37

@unbracketed unbracketed merged commit 9e73d37 into master Mar 23, 2013

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment