mirror of
https://github.com/natelandau/obsidian-metadata.git
synced 2025-11-14 07:53:47 -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:
18
tests/application_test.py
Normal file
18
tests/application_test.py
Normal 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
|
||||
Reference in New Issue
Block a user