feat: Add tests to refactored init command

This commit is contained in:
Cristian 2020-08-20 16:47:02 -05:00 committed by Cristian Vargas
parent 404f333e17
commit be0dff8126
3 changed files with 81 additions and 12 deletions

View file

@ -26,6 +26,7 @@ from .util import enforce_types # type: ignore
from .system import get_dir_size, dedupe_cron_jobs, CRON_COMMENT
from .index import (
load_main_index,
get_empty_snapshot_queryset,
parse_links_from_source,
dedupe_links,
write_main_index,
@ -317,7 +318,7 @@ def init(force: bool=False, out_dir: str=OUTPUT_DIR) -> None:
print()
print('{green}[*] Collecting links from any existing indexes and archive folders...{reset}'.format(**ANSI))
all_links: Dict[str, Link] = {}
all_links = get_empty_snapshot_queryset()
pending_links: Dict[str, Link] = {}
if existing_index: