test: Update more init_tests that were failing because of wording or Link->Snapshot changes

This commit is contained in:
Cristian 2021-01-17 10:03:26 -05:00
parent 49b5241a7c
commit ce5979de45
3 changed files with 7 additions and 6 deletions

View file

@ -42,16 +42,17 @@ MAIN_INDEX_HEADER = {
@enforce_types
def generate_json_index_from_snapshots(snapshots: List[Model], with_headers: bool):
snapshots_json = [snapshot.as_json() for snapshot in snapshots]
if with_headers:
output = {
**MAIN_INDEX_HEADER,
'num_links': len(snapshots),
'updated': datetime.now(),
'last_run_cmd': sys.argv,
'links': snapshots,
'links': snapshots_json,
}
else:
output = snapshots
output = snapshots_json
return to_json(output, indent=4, sort_keys=True)

View file

@ -353,7 +353,7 @@ def init(force: bool=False, out_dir: Path=OUTPUT_DIR) -> None:
orphaned_json_snapshots = {
snapshot.url: snapshot
for snapshot in parse_json_main_index(out_dir)
if not all_snapshots.filter(url=link.url).exists()
if not all_snapshots.filter(url=snapshot.url).exists()
}
if orphaned_json_snapshots:
pending_snapshots.update(orphaned_json_snapshots)