Skip to content

Throw NotImplementedError for AUTH #1910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,15 @@ class ManagementCommands:
Redis management commands
"""

def auth(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a docstring indicating the behaviour. This will help users recognize we have completeness - but not use the function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also - can we add a test to validate the exception is thrown?

"""
This function throws a NotImplementedError since it is intentionally
not supported.
"""
raise NotImplementedError(
"AUTH is intentionally not implemented in the client."
)

def bgrewriteaof(self, **kwargs):
"""Tell the Redis server to rewrite the AOF file from data in memory.

Expand Down
4 changes: 4 additions & 0 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ def test_command_on_invalid_key_type(self, r):
r["a"]

# SERVER INFORMATION
def test_auth_not_implemented(self, r):
with pytest.raises(NotImplementedError):
r.auth()

@skip_if_server_version_lt("6.0.0")
def test_acl_cat_no_category(self, r):
categories = r.acl_cat()
Expand Down