fix: ignore configured write types the plugin cannot handle
This commit is contained in:
parent
53b495249b
commit
991e499fad
3 changed files with 11 additions and 7 deletions
|
|
@ -143,3 +143,11 @@ def test_cmd_scan_defaults_to_current_folder(cwd, monkeypatch):
|
|||
monkeypatch.setattr(sys, 'argv', ['otag', 's'])
|
||||
main()
|
||||
assert (cwd / 'sub' / orvani.CONTEXT_FILE).read_text() == 'doc.pdf --- #lofi\n'
|
||||
|
||||
|
||||
def test_write_ignores_configured_types_the_plugin_cannot_handle(cwd):
|
||||
(cwd / orvani.CONFIG_FILE).write_text('[pdf]\ntypes = [".xyz", ".abc", ".pdf"]\n')
|
||||
(cwd / 'doc.abc').write_text('not a pdf')
|
||||
OrvaniTag().add('doc.abc', '#lofi')
|
||||
assert OrvaniTag().write_metadata('doc.abc', 'pdf') == [4, ['.pdf'], 'pdf', True]
|
||||
assert (cwd / 'doc.abc').read_text() == 'not a pdf'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue