Skip to content

Commit d7dab86

Browse files
authored
Throw NotImplementedError for AUTH (#1910)
* unsupported auth * unsupported-auth * add test and docstring * fix docstring
1 parent a87a750 commit d7dab86

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

redis/commands/core.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,15 @@ class ManagementCommands:
315315
Redis management commands
316316
"""
317317

318+
def auth(self):
319+
"""
320+
This function throws a NotImplementedError since it is intentionally
321+
not supported.
322+
"""
323+
raise NotImplementedError(
324+
"AUTH is intentionally not implemented in the client."
325+
)
326+
318327
def bgrewriteaof(self, **kwargs):
319328
"""Tell the Redis server to rewrite the AOF file from data in memory.
320329

tests/test_commands.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ def test_command_on_invalid_key_type(self, r):
7171
r["a"]
7272

7373
# SERVER INFORMATION
74+
def test_auth_not_implemented(self, r):
75+
with pytest.raises(NotImplementedError):
76+
r.auth()
77+
7478
@skip_if_server_version_lt("6.0.0")
7579
def test_acl_cat_no_category(self, r):
7680
categories = r.acl_cat()

0 commit comments

Comments
 (0)