Skip to content

Commit

Permalink
Add test_deepupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Feb 18, 2017
1 parent f6c5200 commit 6993baf
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from flask_rest_api.utils import deepupdate


class TestUtils():

def test_deepupdate(self):
"""Test deepupdate function
Taken from http://stackoverflow.com/questions/38987#8310229
"""
pluto_original = {
'name': 'Pluto',
'details': {
'tail': True,
'color': 'orange'
}
}

pluto_update = {
'name': 'Pluutoo',
'details': {
'color': 'blue'
}
}

assert deepupdate(pluto_original, pluto_update) == {
'name': 'Pluutoo',
'details': {
'color': 'blue',
'tail': True
}
}

0 comments on commit 6993baf

Please sign in to comment.