From faaf869b3b7030b1f2ecd7f7f14efca93c4a5437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=A3=9E?= Date: Fri, 20 Dec 2024 16:39:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=97=B6=E6=B7=BB=E5=8A=A0=E4=BA=86null=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/utils/tests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/utils/tests.py b/sql/utils/tests.py index 512e0f5edd..bf75778ecd 100644 --- a/sql/utils/tests.py +++ b/sql/utils/tests.py @@ -608,6 +608,7 @@ def test_data_masking_not_hit_rules(self, _inception): @patch("sql.utils.data_masking.GoInceptionEngine") def test_data_masking_hit_rules_not_exists_star(self, _inception): + """数据库返回时添加了null结果。""" _inception.return_value.query_data_masking.return_value = [ { "index": 0, @@ -619,7 +620,7 @@ def test_data_masking_hit_rules_not_exists_star(self, _inception): } ] sql = """select phone from users;""" - rows = (("18888888888",), ("18888888889",), ("18888888810",)) + rows = (("18888888888",), (None,), ("18888888889",), ("18888888810",)) query_result = ReviewSet(column_list=["phone"], rows=rows, full_sql=sql) r = data_masking(self.ins, "archery", sql, query_result) print("test_data_masking_hit_rules_not_exists_star:", r.rows) @@ -627,6 +628,9 @@ def test_data_masking_hit_rules_not_exists_star(self, _inception): [ "188****8888", ], + [ + None, + ], [ "188****8889", ],