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:
Nathaniel Landau
2023-01-23 00:31:08 +00:00
parent 3fd6866760
commit b7735760e9
6 changed files with 67 additions and 5 deletions

18
tests/application_test.py Normal file
View File

@@ -0,0 +1,18 @@
# type: ignore
"""Tests for the application module."""
from obsidian_metadata._config import Config
from obsidian_metadata.models.application import Application
def test_load_vault(test_vault) -> None:
"""Test application."""
vault_path = test_vault
config = Config(config_path="tests/fixtures/test_vault_config.toml", vault_path=vault_path)
app = Application(config=config, dry_run=False)
app.load_vault()
assert app.dry_run is False
assert app.config == config
assert app.vault.num_notes() == 2