Skip to content
Browse files

modified tests to check for type as well, added failing subclass test…

…s for str & bool
  • Loading branch information...
1 parent df8d5c6 commit 6b5b6683a3021ecca7c0138aecc16a69cd30ff66 @eguven committed
Showing with 7 additions and 1 deletion.
  1. +7 −1 memcache.py
View
8 memcache.py
@@ -1040,7 +1040,7 @@ def test_setget(key, val):
print("Testing set/get {'%s': %s} ..." % (to_s(key), to_s(val)), end=' ')
mc.set(key, val)
newval = mc.get(key)
- if newval == val:
+ if newval == val and type(newval) == type(val):
print("OK")
return 1
else:
@@ -1058,8 +1058,14 @@ def __eq__(self, other):
return self.bar == other.bar
return 0
+ class StrSubclass(str):
+ pass
+
test_setget("a_string", "some random string")
+ test_setget("a_string_subclass", StrSubclass("L337 57R"))
test_setget("an_integer", 42)
+ test_setget("bool_True", True)
+ test_setget("bool_False", False)
if test_setget("long", int(1<<30)):
print("Testing delete ...", end=' ')
if mc.delete("long"):

0 comments on commit 6b5b668

Please sign in to comment.
Something went wrong with that request. Please try again.