From 05868f9990557510922b5fbd5377cb20986918e6 Mon Sep 17 00:00:00 2001 From: Maria Mozgunova Date: Wed, 27 Jul 2022 14:10:52 +0300 Subject: [PATCH] Add test and amend docstrings --- src/ytdl_sub/cli/download_args_parser.py | 2 +- tests/unit/cli/test_download_args_parser.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ytdl_sub/cli/download_args_parser.py b/src/ytdl_sub/cli/download_args_parser.py index 75c41de8..3931107f 100644 --- a/src/ytdl_sub/cli/download_args_parser.py +++ b/src/ytdl_sub/cli/download_args_parser.py @@ -88,7 +88,7 @@ class DownloadArgsParser: :param indices: List of indices :return: Largest integer n + 1 so that all the integers from 0 up to n exist in the indices. - -1 if indices list is empty or the smallest integer in indices is larger that 0. + 0 if indices list is empty or the smallest integer in indices is larger than 0. """ largest_consecutive = -1 indices.sort() diff --git a/tests/unit/cli/test_download_args_parser.py b/tests/unit/cli/test_download_args_parser.py index be129979..ab175030 100644 --- a/tests/unit/cli/test_download_args_parser.py +++ b/tests/unit/cli/test_download_args_parser.py @@ -86,6 +86,11 @@ class TestDownloadArgsParser: "dl --parameter.using.list[2] 'v3' --parameter.using.list[1] 'v1' --parameter.using.list[2] 'v2'", {"parameter": {"using": {"list": ["v1", "v2"]}}}, ), + ( + None, + "dl --parameter.using.list[3] 'v3' --parameter.using.list[1] 'v1'", + {"parameter": {"using": {"list": ["v1"]}}}, + ), ( None, "dl --parameter.not.using.list[0] 'v0'",