fix: replace inverted -r flag with -n/--no-recursive
This commit is contained in:
parent
be71728e1a
commit
81d9d62db3
3 changed files with 20 additions and 2 deletions
|
|
@ -102,3 +102,21 @@ def test_cmd_prints_errors(cwd, monkeypatch, capsys):
|
|||
main()
|
||||
assert exit.value.code == 1
|
||||
assert '.otag:1' in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_cmd_list_is_recursive_unless_no_recursive(cwd, monkeypatch, capsys):
|
||||
(cwd / 'a.mp3').touch()
|
||||
(cwd / 'sub').mkdir()
|
||||
(cwd / 'sub' / 'deep.mp3').touch()
|
||||
OrvaniTag().add('a.mp3', '#lofi')
|
||||
OrvaniTag().add('sub/deep.mp3', '#lofi')
|
||||
|
||||
monkeypatch.setattr(sys, 'argv', ['otag', 'ls', '#lofi'])
|
||||
main()
|
||||
out = capsys.readouterr().out
|
||||
assert 'a.mp3' in out and 'deep.mp3' in out
|
||||
|
||||
monkeypatch.setattr(sys, 'argv', ['otag', 'ls', '-n', '#lofi'])
|
||||
main()
|
||||
out = capsys.readouterr().out
|
||||
assert 'a.mp3' in out and 'deep.mp3' not in out
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue