Skip to content

Commit

Permalink
tests-for-merge-objects
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed May 31, 2024
1 parent cdb2842 commit 06bd6cd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test_misc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3684,6 +3684,22 @@ def test_merge_objects_8():
assert target == expected


def test_merge_objects_9():
target = {"abc": [1, 2, 3]}
source = {"abc": [4, 5]}
expected = {"abc": [4, 5]}
result = merge_objects(target, source, primitive_lists=True, copy=True)
assert result == expected
assert id(target) != id(result)

target = {"abc": [1, 2, 3]}
source = {"abc": [4, 5]}
expected = {"abc": [4, 5, 3]}
result = merge_objects(target, source, primitive_lists=False, copy=False)
assert result == expected
assert id(target) == id(result)


def test_to_integer():
assert to_integer("17") == 17
assert to_integer("17.0") == 17
Expand Down

0 comments on commit 06bd6cd

Please sign in to comment.