File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: UTF-8 -*-
2
- """
2
+ """
3
3
@author: hhyo
4
4
@license: Apache Licence
5
5
@file: tests.py
@@ -340,14 +340,16 @@ def test_rewrite(self, _subprocess):
340
340
341
341
def test_password_mixin (mocker : MockerFixture ):
342
342
from sql .plugins .password import requests
343
+
343
344
class MockReponse (Mock ):
344
345
def json (self ):
345
346
return {"data" : {"username" : "test" , "password" : "test" , "ttl" : 360 }}
347
+
346
348
mocker .patch .object (requests , "get" , return_value = MockReponse ())
347
-
349
+
348
350
class DummyInstance :
349
351
instance_name = "dummy"
350
-
352
+
351
353
class CompondInstance (DummyInstance , VaultMixin ):
352
354
pass
353
355
Original file line number Diff line number Diff line change 1
1
"""models.py 的补充测试"""
2
+
2
3
from django .conf import settings
3
4
from sql .models import InstanceTag
4
5
@@ -12,4 +13,5 @@ def test_instance_tag_str():
12
13
def test_password_mixin_import_error ():
13
14
settings .PASSWORD_MIXIN_PATH = "sql.not_found:ErrorMixin"
14
15
from sql .models import PasswordMixin
16
+
15
17
assert PasswordMixin .__name__ == "DummyMixin"
You can’t perform that action at this time.
0 commit comments