Skip to content

Commit

Permalink
added tests for cluster client
Browse files Browse the repository at this point in the history
  • Loading branch information
amirreza8002 committed Oct 3, 2024
1 parent 12d4532 commit 99c6d5d
Show file tree
Hide file tree
Showing 5 changed files with 1,434 additions and 12 deletions.
32 changes: 20 additions & 12 deletions tests/settings/sqlite_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,32 @@

CACHES = {
"default": {
"BACKEND": "django_valkey.cache.ValkeyCache",
"LOCATION": ["valkey://127.0.0.1:6379", "valkey://127.0.0.1:6379"],
"OPTIONS": {"CLIENT_CLASS": "django_valkey.client.DefaultClient"},
"BACKEND": "django_valkey.cluster_cache.cache.ClusterValkeyCache",
"LOCATION": ["valkey://127.0.0.1:7005", "valkey://127.0.0.1:7005"],
"OPTIONS": {
"CLIENT_CLASS": "django_valkey.cluster_cache.client.DefaultClusterClient"
},
},
"doesnotexist": {
"BACKEND": "django_valkey.cache.ValkeyCache",
"LOCATION": "valkey://127.0.0.1:56379?db=1",
"OPTIONS": {"CLIENT_CLASS": "django_valkey.client.DefaultClient"},
"BACKEND": "django_valkey.cluster_cache.cache.ClusterValkeyCache",
"LOCATION": "valkey://127.0.0.1:56379?db=0",
"OPTIONS": {
"CLIENT_CLASS": "django_valkey.cluster_cache.client.DefaultClusterClient"
},
},
"sample": {
"BACKEND": "django_valkey.cache.ValkeyCache",
"LOCATION": "valkey://127.0.0.1:6379:1,valkey://127.0.0.1:6379:1",
"OPTIONS": {"CLIENT_CLASS": "django_valkey.client.DefaultClient"},
"BACKEND": "django_valkey.cluster_cache.cache.ClusterValkeyCache",
"LOCATION": "valkey://127.0.0.1:7005:0,valkey://127.0.0.1:7002:0",
"OPTIONS": {
"CLIENT_CLASS": "django_valkey.cluster_cache.client.DefaultClusterClient"
},
},
"with_prefix": {
"BACKEND": "django_valkey.cache.ValkeyCache",
"LOCATION": "valkey://127.0.0.1:6379?db=1",
"OPTIONS": {"CLIENT_CLASS": "django_valkey.client.DefaultClient"},
"BACKEND": "django_valkey.cluster_cache.cache.ClusterValkeyCache",
"LOCATION": "valkey://127.0.0.1:7005?db=0",
"OPTIONS": {
"CLIENT_CLASS": "django_valkey.cluster_cache.client.DefaultClusterClient"
},
"KEY_PREFIX": "test-prefix",
},
}
Expand Down
Empty file added tests/tests_cluster/__init__.py
Empty file.
Loading

0 comments on commit 99c6d5d

Please sign in to comment.