def test_paths_to_watch(example_ledger: FavaLedger) -> None: assert example_ledger.paths_to_watch() == ( [example_ledger.beancount_file_path], [], ) example_ledger.options["documents"] = ["folder"] base = Path(example_ledger.beancount_file_path).parent / "folder" assert example_ledger.paths_to_watch() == ( [example_ledger.beancount_file_path], [ str(base / account) for account in [ "Assets", "Liabilities", "Equity", "Income", "Expenses", ] ], )
def test_paths_to_watch(example_ledger: FavaLedger, monkeypatch: MonkeyPatch) -> None: assert example_ledger.paths_to_watch() == ( [example_ledger.beancount_file_path], [], ) monkeypatch.setitem( example_ledger.options, "documents", ["folder"] # type: ignore ) base = Path(example_ledger.beancount_file_path).parent / "folder" assert example_ledger.paths_to_watch() == ( [example_ledger.beancount_file_path], [ str(base / account) for account in [ "Assets", "Liabilities", "Equity", "Income", "Expenses", ] ], )