Browse Source

use unittest2 for python2.6

master
Brett Langdon 12 years ago
parent
commit
c7848251b5
2 changed files with 12 additions and 10 deletions
  1. +11
    -10
      riakcached/tests/test_client.py
  2. +1
    -0
      test-requirements.txt

+ 11
- 10
riakcached/tests/test_client.py View File

@ -1,14 +1,15 @@
import unittest
import mock import mock
import unittest2
import urllib3.exceptions import urllib3.exceptions
from riakcached import exceptions from riakcached import exceptions
from riakcached.client import RiakClient from riakcached.client import RiakClient
from riakcached.tests.utils import InlineClass from riakcached.tests.utils import InlineClass
class TestRiakClient(unittest.TestCase):
class TestRiakClient(unittest2.TestCase):
def setUp(self): def setUp(self):
self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.patched_connection_from_url = mock.patch("urllib3.connection_from_url")
self.connection_from_url = self.patched_connection_from_url.start() self.connection_from_url = self.patched_connection_from_url.start()
@ -76,7 +77,7 @@ class TestRiakClient(unittest.TestCase):
) )
class TestGet(unittest.TestCase):
class TestGet(unittest2.TestCase):
def setUp(self): def setUp(self):
self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.patched_connection_from_url = mock.patch("urllib3.connection_from_url")
self.connection_from_url = self.patched_connection_from_url.start() self.connection_from_url = self.patched_connection_from_url.start()
@ -179,7 +180,7 @@ class TestGet(unittest.TestCase):
) )
class TestSet(unittest.TestCase):
class TestSet(unittest2.TestCase):
def setUp(self): def setUp(self):
self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.patched_connection_from_url = mock.patch("urllib3.connection_from_url")
self.connection_from_url = self.patched_connection_from_url.start() self.connection_from_url = self.patched_connection_from_url.start()
@ -297,7 +298,7 @@ class TestSet(unittest.TestCase):
) )
class TestDelete(unittest.TestCase):
class TestDelete(unittest2.TestCase):
def setUp(self): def setUp(self):
self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.patched_connection_from_url = mock.patch("urllib3.connection_from_url")
self.connection_from_url = self.patched_connection_from_url.start() self.connection_from_url = self.patched_connection_from_url.start()
@ -364,7 +365,7 @@ class TestDelete(unittest.TestCase):
) )
class TestCounter(unittest.TestCase):
class TestCounter(unittest2.TestCase):
def setUp(self): def setUp(self):
self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.patched_connection_from_url = mock.patch("urllib3.connection_from_url")
self.connection_from_url = self.patched_connection_from_url.start() self.connection_from_url = self.patched_connection_from_url.start()
@ -423,7 +424,7 @@ class TestCounter(unittest.TestCase):
self.assertFalse(client.incr("test")) self.assertFalse(client.incr("test"))
class TestPing(unittest.TestCase):
class TestPing(unittest2.TestCase):
def setUp(self): def setUp(self):
self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.patched_connection_from_url = mock.patch("urllib3.connection_from_url")
self.connection_from_url = self.patched_connection_from_url.start() self.connection_from_url = self.patched_connection_from_url.start()
@ -463,7 +464,7 @@ class TestPing(unittest.TestCase):
self.assertFalse(client.ping()) self.assertFalse(client.ping())
class TestStats(unittest.TestCase):
class TestStats(unittest2.TestCase):
def setUp(self): def setUp(self):
self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.patched_connection_from_url = mock.patch("urllib3.connection_from_url")
self.connection_from_url = self.patched_connection_from_url.start() self.connection_from_url = self.patched_connection_from_url.start()
@ -503,7 +504,7 @@ class TestStats(unittest.TestCase):
self.assertIsNone(client.stats()) self.assertIsNone(client.stats())
class TestProps(unittest.TestCase):
class TestProps(unittest2.TestCase):
def setUp(self): def setUp(self):
self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.patched_connection_from_url = mock.patch("urllib3.connection_from_url")
self.connection_from_url = self.patched_connection_from_url.start() self.connection_from_url = self.patched_connection_from_url.start()
@ -563,7 +564,7 @@ class TestProps(unittest.TestCase):
) )
class TestKeys(unittest.TestCase):
class TestKeys(unittest2.TestCase):
def setUp(self): def setUp(self):
self.patched_connection_from_url = mock.patch("urllib3.connection_from_url") self.patched_connection_from_url = mock.patch("urllib3.connection_from_url")
self.connection_from_url = self.patched_connection_from_url.start() self.connection_from_url = self.patched_connection_from_url.start()


+ 1
- 0
test-requirements.txt View File

@ -1,2 +1,3 @@
mock mock
unittest2
-r requirements.txt -r requirements.txt

Loading…
Cancel
Save