Skip to content

Commit

Permalink
Make test uds path consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
alisaifee committed May 16, 2020
1 parent c91133d commit f15ae4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/redis-configurations/unixdomainsocket.conf
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ tcp-backlog 511
# incoming connections. There is no default, so Redis will not listen
# on a unix socket when not specified.
#
unixsocket /var/tmp/limits.redis.sock
unixsocket /tmp/limits.redis.sock
# unixsocketperm 700

# Close the connection after a client is idle for N seconds (0 to disable)
Expand Down
12 changes: 6 additions & 6 deletions tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class BaseStorageTests(unittest.TestCase):
def setUp(self):
pymemcache.client.Client(('localhost', 22122)).flush_all()
redis.from_url('unix:///var/tmp/limits.redis.sock').flushall()
redis.from_url('unix:///tmp/limits.redis.sock').flushall()
redis.from_url("redis://localhost:7379").flushall()
redis.from_url("redis://:sekret@localhost:7389").flushall()
redis.sentinel.Sentinel([
Expand All @@ -49,13 +49,13 @@ def test_storage_string(self):
)
self.assertTrue(
isinstance(
storage_from_string("redis+unix:///var/tmp/limits.redis.sock"), RedisStorage
storage_from_string("redis+unix:///tmp/limits.redis.sock"), RedisStorage
)
)

self.assertTrue(
isinstance(
storage_from_string("redis+unix://:password/var/tmp/limits.redis.sock"), RedisStorage
storage_from_string("redis+unix://:password/tmp/limits.redis.sock"), RedisStorage
)
)

Expand Down Expand Up @@ -128,7 +128,7 @@ def test_storage_check(self):
self.assertTrue(storage_from_string("memory://").check())
self.assertTrue(storage_from_string("redis://localhost:7379").check())
self.assertTrue(storage_from_string("redis://:sekret@localhost:7389").check())
self.assertTrue(storage_from_string("redis+unix:///var/tmp/limits.redis.sock").check())
self.assertTrue(storage_from_string("redis+unix:///tmp/limits.redis.sock").check())
self.assertTrue(
storage_from_string("memcached://localhost:22122").check()
)
Expand Down Expand Up @@ -342,9 +342,9 @@ def test_init_options(self):

class RedisUnixSocketStorageTests(SharedRedisTests, unittest.TestCase):
def setUp(self):
self.storage_url = "redis+unix:///var/tmp/limits.redis.sock"
self.storage_url = "redis+unix:///tmp/limits.redis.sock"
self.storage = RedisStorage(self.storage_url)
redis.from_url('unix:///var/tmp/limits.redis.sock').flushall()
redis.from_url('unix:///tmp/limits.redis.sock').flushall()

def test_init_options(self):
with mock.patch("limits.storage.get_dependency") as get_dependency:
Expand Down

0 comments on commit f15ae4e

Please sign in to comment.