7 Session, GnuCashBackendException,
9 ERR_BACKEND_LOCKED, ERR_FILEIO_FILE_NOT_FOUND
12 FILE_1 =
"/tmp/not_there.xac" 13 FILE_2 =
"/tmp/example_file.xac" 18 session = Session(FILE_1)
19 except GnuCashBackendException
as backend_exception:
20 assert( ERR_FILEIO_FILE_NOT_FOUND
in backend_exception.errors)
24 with Session(
"xml://%s" % FILE_2, SessionOpenMode.SESSION_NEW_STORE)
as session:
26 root = book.get_root_account()
29 with Session(FILE_2)
as session:
31 session_2 = Session(FILE_2)
32 except GnuCashBackendException
as backend_exception:
33 assert( ERR_BACKEND_LOCKED
in backend_exception.errors )