Skip to content

Commit

Permalink
数据库返回时添加了null结果。
Browse files Browse the repository at this point in the history
  • Loading branch information
feiazifeiazi committed Dec 20, 2024
1 parent 9c4a1e8 commit faaf869
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sql/utils/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -619,14 +620,17 @@ 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)
mask_result_rows = [
[
"188****8888",
],
[
None,
],
[
"188****8889",
],
Expand Down

0 comments on commit faaf869

Please sign in to comment.