Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
Django-Redis-Cache
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shared
Django-Redis-Cache
Commits
a88f1e2f
Commit
a88f1e2f
authored
Jul 16, 2015
by
Sean Bleier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Up the delay a bit.
parent
a507852a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
master_slave_tests.py
tests/testapp/tests/master_slave_tests.py
+11
-11
No files found.
tests/testapp/tests/master_slave_tests.py
View file @
a88f1e2f
...
...
@@ -11,11 +11,11 @@ from redis_cache.connection import pool
from
tests.testapp.tests.base_tests
import
SetupMixin
MASTER_LOCATION
=
"127.0.0.
1
:6387"
MASTER_LOCATION
=
"127.0.0.
2
:6387"
LOCATIONS
=
[
'127.0.0.
1
:6387'
,
'127.0.0.
1
:6388'
,
'127.0.0.
1
:6389'
,
'127.0.0.
2
:6387'
,
'127.0.0.
2
:6388'
,
'127.0.0.
2
:6389'
,
]
...
...
@@ -43,14 +43,14 @@ class MasterSlaveTestCase(SetupMixin, TestCase):
client
=
cache
.
master_client
self
.
assertEqual
(
client
.
connection_pool
.
connection_identifier
,
(
'127.0.0.
1
'
,
6387
,
1
,
None
)
(
'127.0.0.
2
'
,
6387
,
1
,
None
)
)
self
.
assertEqual
(
len
(
pool
.
_connection_pools
),
3
)
def
test_set
(
self
):
cache
=
self
.
get_cache
()
cache
.
set
(
'a'
,
'a'
)
time
.
sleep
(
.
1
)
time
.
sleep
(
.
2
)
for
client
in
self
.
cache
.
clients
.
values
():
key
=
cache
.
make_key
(
'a'
)
self
.
assertIsNotNone
(
client
.
get
(
key
))
...
...
@@ -68,7 +68,7 @@ class MasterSlaveTestCase(SetupMixin, TestCase):
cache
=
self
.
get_cache
()
cache
.
set
(
'a'
,
0
)
cache
.
incr
(
'a'
)
time
.
sleep
(
.
1
)
time
.
sleep
(
.
2
)
key
=
cache
.
make_key
(
'a'
)
for
client
in
self
.
cache
.
clients
.
values
():
self
.
assertEqual
(
int
(
client
.
get
(
key
)),
1
)
...
...
@@ -76,10 +76,10 @@ class MasterSlaveTestCase(SetupMixin, TestCase):
def
test_delete
(
self
):
cache
=
self
.
get_cache
()
cache
.
set
(
'a'
,
'a'
)
time
.
sleep
(
.
1
)
time
.
sleep
(
.
2
)
self
.
assertEqual
(
cache
.
get
(
'a'
),
'a'
)
cache
.
delete
(
'a'
)
time
.
sleep
(
.
1
)
time
.
sleep
(
.
2
)
key
=
cache
.
make_key
(
'a'
)
for
client
in
self
.
cache
.
clients
.
values
():
self
.
assertIsNone
(
client
.
get
(
key
))
...
...
@@ -87,9 +87,9 @@ class MasterSlaveTestCase(SetupMixin, TestCase):
def
test_clear
(
self
):
cache
=
self
.
get_cache
()
cache
.
set
(
'a'
,
'a'
)
time
.
sleep
(
.
1
)
time
.
sleep
(
.
2
)
self
.
assertEqual
(
cache
.
get
(
'a'
),
'a'
)
cache
.
clear
()
time
.
sleep
(
.
1
)
time
.
sleep
(
.
2
)
for
client
in
self
.
cache
.
clients
.
values
():
self
.
assertEqual
(
len
(
client
.
keys
(
'*'
)),
0
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment