Skip to content

Commit 5a2ef2f

Browse files
committed
fixed build issues
1 parent 4efb99d commit 5a2ef2f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/sonic-py-common/tests/test_security_cipher.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
class TestSecurityCipher(object):
1515
def test_passkey_encryption(self):
16-
with mock.patch("sonic_py_common.security_cipher.ConfigDBConnector", new=ConfigDBConnector):
16+
with mock.patch("sonic_py_common.security_cipher.ConfigDBConnector", new=ConfigDBConnector), \
17+
mock.patch("builtins.open", mock_open()) as mock_file:
1718
temp = security_cipher()
1819

1920
# Use patch to replace the built-in 'open' function with a mock
@@ -23,7 +24,8 @@ def test_passkey_encryption(self):
2324
assert err == None
2425

2526
def test_passkey_decryption(self):
26-
with mock.patch("sonic_py_common.security_cipher.ConfigDBConnector", new=ConfigDBConnector):
27+
with mock.patch("sonic_py_common.security_cipher.ConfigDBConnector", new=ConfigDBConnector), \
28+
mock.patch("builtins.open", mock_open()) as mock_file:
2729
temp = security_cipher()
2830

2931
# Use patch to replace the built-in 'open' function with a mock

0 commit comments

Comments
 (0)