def test_file_enc_dec(): fc = FileCrypt(FILENAME) fc.password = setup_fc._gen_password(PASSWORD, salt_info) fc.encrypt() fc.password = setup_fc._gen_password(PASSWORD, salt_info) fc.decrypt() with open(FILENAME, u'r') as f: og_data = f.readlines() assert og_data == FILE_DATA
def test_change_password(): fc = FileCrypt(FILENAME) test_password = setup_fc._gen_password(PASSWORD, salt_info) fc.password = test_password fc.encrypt() assert fc.change_password(test_password, setup_fc._gen_password('new password', salt_info)) is True
def test_change_password(): fc = FileCrypt(FILENAME) test_password = setup_fc._gen_password(PASSWORD, salt_info) fc.password = test_password fc.encrypt() assert fc.change_password( test_password, setup_fc._gen_password('new password', salt_info)) is True
def test_decrypt_no_file(): fc = FileCrypt(FILENAME) fc.password = setup_fc._gen_password(PASSWORD, salt_info) fc.decrypt()
def test_enc_file_name(): fc = FileCrypt(FILENAME) fc.password = setup_fc._gen_password(PASSWORD, salt_info) fc.encrypt() assert os.path.exists(FILENAME_ENC) is True