From aa4cb3e06bb653d22d22c5eae7cf2c04e4bece99 Mon Sep 17 00:00:00 2001 From: "Gavin M. Roy" Date: Wed, 3 Sep 2014 12:04:12 -0400 Subject: [PATCH] Add simple integration tests --- .travis.yml | 2 ++ tests.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/.travis.yml b/.travis.yml index 13a6199..38a4406 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,8 @@ install: script: nosetests after_success: - coveralls +services: + - memcached deploy: provider: pypi user: sprockets diff --git a/tests.py b/tests.py index 55ae9af..dd6bc39 100644 --- a/tests.py +++ b/tests.py @@ -52,3 +52,19 @@ class TestClientWrapsMemcacheClient(unittest.TestCase): False, 0, True) + + +class ClientIntegrationTests(unittest.TestCase): + + def setUp(self): + self.client = memcached.Client() + self.client.incr('test') + if any([s.deaduntil for s in self.client.servers]): + raise unittest.SkipTest('No memcached daemon present') + + def test_that_incr_returns_one(self): + self.assertEqual(self.client.incr('test-incr'), 1) + + def test_that_set_key_is_gettable(self): + self.client.set('foo', 'bar', 60) + self.assertEqual(self.client.get('foo'), 'bar')