File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 55from cryptography .fernet import Fernet
66
77from murfey .cli .decrypt_db_password import run
8- from murfey .util .config import get_security_config
8+ from murfey .util .config import get_global_config
99
1010
1111def test_decrypt_password (capsys , tmp_path ):
12- security_config = get_security_config ()
12+ global_config = get_global_config ()
1313 crypto_key = Fernet .generate_key ()
14- security_config .crypto_key = crypto_key .decode ("ascii" )
14+ global_config .crypto_key = crypto_key .decode ("ascii" )
1515 with open (tmp_path / "config.yaml" , "w" ) as cfg :
16- yaml .dump (security_config .dict (), cfg )
17- os .environ ["MURFEY_SECURITY_CONFIGURATION " ] = str (tmp_path / "config.yaml" )
16+ yaml .dump (global_config .dict (), cfg )
17+ os .environ ["MURFEY_global_configURATION " ] = str (tmp_path / "config.yaml" )
1818 password = "abcd"
1919 f = Fernet (crypto_key )
2020 encrypted_password = f .encrypt (password .encode ("ascii" )).decode ()
Original file line number Diff line number Diff line change 44from cryptography .fernet import Fernet
55
66from murfey .cli .generate_db_password import run
7- from murfey .util .config import get_security_config
7+ from murfey .util .config import get_global_config
88
99
1010def test_generate_password (capsys , tmp_path ):
11- security_config = get_security_config ()
11+ global_config = get_global_config ()
1212 crypto_key = Fernet .generate_key ()
13- security_config .crypto_key = crypto_key .decode ("ascii" )
13+ global_config .crypto_key = crypto_key .decode ("ascii" )
1414 with open (tmp_path / "config.yaml" , "w" ) as cfg :
15- yaml .dump (security_config .dict (), cfg )
16- os .environ ["MURFEY_SECURITY_CONFIGURATION " ] = str (tmp_path / "config.yaml" )
15+ yaml .dump (global_config .dict (), cfg )
16+ os .environ ["MURFEY_global_configURATION " ] = str (tmp_path / "config.yaml" )
1717 run ()
1818 captured = capsys .readouterr ()
1919 f = Fernet (crypto_key )
You can’t perform that action at this time.
0 commit comments