Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support of common security cipher module for encryption and decryption of a passkey #17201

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/sonic-py-common/tests/test_security_cipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

class TestSecurityCipher(object):
def test_passkey_encryption(self):
with mock.patch("sonic_py_common.security_cipher.ConfigDBConnector", new=ConfigDBConnector):
with mock.patch("sonic_py_common.security_cipher.ConfigDBConnector", new=ConfigDBConnector), \
mock.patch("builtins.open", mock_open()) as mock_file:
temp = security_cipher()
nmoray marked this conversation as resolved.
Show resolved Hide resolved

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

def test_passkey_decryption(self):
with mock.patch("sonic_py_common.security_cipher.ConfigDBConnector", new=ConfigDBConnector):
with mock.patch("sonic_py_common.security_cipher.ConfigDBConnector", new=ConfigDBConnector), \
mock.patch("builtins.open", mock_open()) as mock_file:
temp = security_cipher()
nmoray marked this conversation as resolved.
Show resolved Hide resolved
nmoray marked this conversation as resolved.
Show resolved Hide resolved

# Use patch to replace the built-in 'open' function with a mock
Expand Down
Loading