def test_encrypt_and_decrypt_file(self, file_for_upload, file_upload_test_data): pubnub = PubNub(pnconf_file_copy()) with open(file_for_upload.strpath, "rb") as fd: encrypted_file = pubnub.encrypt(KEY, fd.read()) decrypted_file = pubnub.decrypt(KEY, encrypted_file) assert file_upload_test_data["FILE_CONTENT"] == decrypted_file.decode( "utf-8")