mirror of
https://github.com/natelandau/obsidian-metadata.git
synced 2025-11-17 17:33:40 -05:00
test: add tests for Application class
Need more attention here. Very difficult to test the keyboard interaction with questionary. Going to try using pexpect soon to hopefully add better coverage.
This commit is contained in:
@@ -132,7 +132,7 @@ def clean_dictionary(dictionary: dict[str, Any]) -> dict[str, Any]:
|
||||
return new_dict
|
||||
|
||||
|
||||
def clear_screen() -> None:
|
||||
def clear_screen() -> None: # pragma: no cover
|
||||
"""Clears the screen."""
|
||||
# for windows
|
||||
_ = system("cls") if name == "nt" else system("clear")
|
||||
|
||||
@@ -34,8 +34,6 @@ class Application:
|
||||
]
|
||||
)
|
||||
|
||||
clear_screen()
|
||||
|
||||
def load_vault(self, path_filter: str = None) -> None:
|
||||
"""Load the vault.
|
||||
|
||||
@@ -47,6 +45,7 @@ class Application:
|
||||
|
||||
def main_app(self) -> None: # noqa: C901
|
||||
"""Questions for the main application."""
|
||||
clear_screen()
|
||||
self.load_vault()
|
||||
|
||||
while True:
|
||||
|
||||
@@ -53,7 +53,7 @@ class Vault:
|
||||
self.metadata.add_metadata(_note.inline_metadata.dict)
|
||||
self.metadata.add_metadata({_note.inline_tags.metadata_key: _note.inline_tags.list})
|
||||
|
||||
def __rich_repr__(self) -> rich.repr.Result:
|
||||
def __rich_repr__(self) -> rich.repr.Result: # pragma: no cover
|
||||
"""Define rich representation of Vault."""
|
||||
yield "vault_path", self.vault_path
|
||||
yield "dry_run", self.dry_run
|
||||
|
||||
Reference in New Issue
Block a user