summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruamin <ruamin@ebay.com>2016-04-14 17:15:51 -0700
committerruamin <ruamin@ebay.com>2016-04-19 10:43:53 -0700
commit081162c7a255c0ae7edf3ee4fb9beac79b1f3407 (patch)
tree3fac266bc429b05c3daa69c6396c356c6befa384
parent0cf26f86ea5dc60c70850fb99b5633d0f6638247 (diff)
downloadpymemcache-081162c7a255c0ae7edf3ee4fb9beac79b1f3407.tar.gz
Fixed stats evictions conversion
Fixed evictions conversion in base.py. evictions stat value was incorrectly being compared to β€œb’on’” previously, which resulted in a boolean. The fix makes the conversion default to int, which is in line with other numeric stats values. Augmented test_stats_conversions test case in test_client.py to test eviction value conversion
-rw-r--r--pymemcache/client/base.py1
-rw-r--r--pymemcache/test/test_client.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/pymemcache/client/base.py b/pymemcache/client/base.py
index ad845d1..c86ca71 100644
--- a/pymemcache/client/base.py
+++ b/pymemcache/client/base.py
@@ -53,7 +53,6 @@ STAT_TYPES = {
# Settings stats
b'inter': six.binary_type,
- b'evictions': lambda value: value == b'on',
b'growth_factor': float,
b'stat_key_prefix': six.binary_type,
b'umask': lambda value: int(value, 8),
diff --git a/pymemcache/test/test_client.py b/pymemcache/test/test_client.py
index c142e6a..e541f10 100644
--- a/pymemcache/test/test_client.py
+++ b/pymemcache/test/test_client.py
@@ -546,6 +546,7 @@ class TestClient(ClientTestMixin, unittest.TestCase):
# Most stats are converted to int
b'STAT cmd_get 2519\r\n',
b'STAT cmd_set 3099\r\n',
+ b'STAT evictions 939\r\n',
# Unless they can't be, they remain str
b'STAT libevent 2.0.19-stable\r\n',
@@ -565,6 +566,7 @@ class TestClient(ClientTestMixin, unittest.TestCase):
expected = {
b'cmd_get': 2519,
b'cmd_set': 3099,
+ b'evictions': 939,
b'libevent': b'2.0.19-stable',
b'hash_is_expanding': False,
b'rusage_user': 0.609165,