Skip to content

Commit

Permalink
add test of the basic cli
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfromearth committed Jun 24, 2024
1 parent 216b319 commit be659c8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_filename_grouping.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import sys
from unittest.mock import patch

import batcher.tempo_filename_parser
from batcher.tempo_filename_parser import get_batch_indices

example_filenames = [
Expand All @@ -14,3 +18,13 @@ def test_grouping():
results = get_batch_indices(example_filenames)

assert results == [0, 0, 0, 1, 1, 1]


def test_main_cli():
test_args = [batcher.tempo_filename_parser.__file__, "-v"]
test_args.extend(example_filenames)

with patch.object(sys, "argv", test_args):
grouped_names = batcher.tempo_filename_parser.main()

assert grouped_names == [example_filenames[0:3], example_filenames[3:6]]

0 comments on commit be659c8

Please sign in to comment.