File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/sonic-py-common/tests Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1313
1414class 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
You can’t perform that action at this time.
0 commit comments