def test_read_mylogin_cnf(): """Tests that a login path file can be read and decrypted.""" mylogin_cnf = open_mylogin_cnf(LOGIN_PATH_FILE) assert isinstance(mylogin_cnf, TextIOWrapper) contents = mylogin_cnf.read() for word in ('[test]', 'user', 'password', 'host', 'port'): assert word in contents
def test_read_mylogin_cnf(): """Tests that a login path file can be read and decrypted.""" mylogin_cnf = open_mylogin_cnf(LOGIN_PATH_FILE) assert isinstance(mylogin_cnf, TextIOWrapper) contents = mylogin_cnf.read() for word in ("[test]", "user", "password", "host", "port"): assert word in contents
def test_read_mylogin_cnf_without_crypto(): with pytest.raises(CryptoError): mylogin_cnf = open_mylogin_cnf(LOGIN_PATH_FILE)