Skip to content
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

根据keyspace获取databases num时,需要加1 #2573

Merged
merged 19 commits into from
Apr 10, 2024

Conversation

feiazifeiazi
Copy link
Contributor

@feiazifeiazi feiazifeiazi commented Apr 10, 2024

fix #2570

Copy link

codecov bot commented Apr 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.86%. Comparing base (f8e1f4b) to head (d760a77).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2573      +/-   ##
==========================================
+ Coverage   76.82%   76.86%   +0.04%     
==========================================
  Files         117      117              
  Lines       16073    16084      +11     
==========================================
+ Hits        12348    12363      +15     
+ Misses       3725     3721       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

sql/engines/redis.py Outdated Show resolved Hide resolved
@LeoQuote
Copy link
Collaborator

加 mock 就好了啊,你正好还可以测试下你的case

@feiazifeiazi
Copy link
Contributor Author

加 mock 就好了啊,你正好还可以测试下你的case

本地单元测试时,总是报这个错。 “报auth_group表不存在。”
加的单元测试,都测不了。。好烦。

2024-04-10 18:14:34,861 - environ.environ - WARNING - Invalid line: AUTH_LDAP_ALWAYS_UPDATE_USER = True
2024-04-10 18:14:35,020 - archery.settings - INFO - 当前生效的外部认证方式:LDAP
2024-04-10 18:14:35,020 - archery.settings - INFO - 认证后端:('django_auth_ldap.backend.LDAPBackend', 'django.contrib.auth.backends.ModelBackend')
============================= test session starts =============================
platform win32 -- Python 3.11.2, pytest-8.1.1, pluggy-1.4.0
django: version: 4.1.10, settings: archery.settings (from ini)
rootdir: d:\Users\Administrator\Source\Workspaces\Archery_Genuine2
configfile: pyproject.toml
plugins: django-4.8.0, mock-3.14.0
collected 1 item

sql\engines\tests.py
Got an error creating the test database: (1007, "Can't create database 'test_archery'; database exists")
E

=================================== ERRORS ====================================
_____________ ERROR at setup of TestRedis.test_get_all_databases ______________

self = <django.db.backends.utils.CursorWrapper object at 0x0000025B59F3F2D0>
sql = 'ALTER TABLE sql_users_groups ADD CONSTRAINT sql_users_groups_group_id_d572a82e_fk_auth_group_id FOREIGN KEY (group_id) REFERENCES auth_group (id)'
params = ()
ignored_wrapper_args = (False, {'connection': , 'cursor': <django.db.backends.utils.CursorWrapper object at 0x0000025B59F3F2D0>})

def _execute(self, sql, params, *ignored_wrapper_args):
    self.db.validate_no_broken_transaction()
    with self.db.wrap_database_errors:
        if params is None:
            # params default might be backend specific.
            return self.cursor.execute(sql)
        else:
          return self.cursor.execute(sql, params)

c:\Users\Administrator\archery_venv\Lib\site-packages\django\db\backends\utils.py:89:


Copy link
Collaborator

@LeoQuote LeoQuote left a comment

Choose a reason for hiding this comment

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

100% 覆盖率👏

@LeoQuote LeoQuote merged commit 370d8c0 into hhyo:master Apr 10, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug-Redis的数据库列表少了一个
2 participants