mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
Fix issue with looping in list merging
The last_dest_idx variable should always have been tracking the last index in the source list. The original intention, implemented incorrectly, was to just append any items which source has no item at that index.
This commit is contained in:
@@ -630,6 +630,8 @@ def test_get_sample_template_returns_template(template_type):
|
||||
([{"b": "c"}], [{"b": "e"}], [{"b": "e"}]),
|
||||
# if nested dicts in lists have different keys, additive behaviour
|
||||
([{"b": "c"}], [{"d": {"e": "f"}}], [{"b": "c", "d": {"e": "f"}}]),
|
||||
# if dicts in destination list but not source, they just get added to end of source
|
||||
([{"a": "b"}], [{"a": "b"}, {"a": "b"}, {"c": "d"}], [{"a": "b"}, {"a": "b"}, {"c": "d"}]),
|
||||
# merge a dict with a null object returns that dict (does not work the other way round)
|
||||
({"a": {"b": "c"}}, None, {"a": {"b": "c"}}),
|
||||
# double nested dicts, new adds new Boolean key: value, additive behaviour
|
||||
|
||||
Reference in New Issue
Block a user