예제 #1
0
파일: test_utils.py 프로젝트: db48x/dxr
 def test_mappings(self):
     """Make sure mapping-type values get merged."""
     dest = {
         'line': {
             'properties': {
                 'path': {  # A key will be added within this.
                     'type': 'string',
                     'index': 'not_analyzed'
                 }
             }  # A key will be added after this mapping-valued key.
         },
         'dash': {  # This key's value will be unchanged.
             'nothing': 'here'
         }
     }
     source = {
         'line': {
             'properties': {
                 'path': {
                     'new': 'thing'
                 }
             },
             'floperties': {
                 'a': 'flop'
             }
         }
     }
     eq_(deep_update(dest, source),
         {
             'line': {
                 'properties': {
                     'path': {
                         'type': 'string',
                         'index': 'not_analyzed',
                         'new': 'thing'
                     }
                 },
                 'floperties': {
                     'a': 'flop'
                 }
             },
             'dash': {
                 'nothing': 'here'
             }
         })
예제 #2
0
 def test_mappings(self):
     """Make sure mapping-type values get merged."""
     dest = {
         'line': {
             'properties': {
                 'path': {  # A key will be added within this.
                     'type': 'string',
                     'index': 'not_analyzed'
                 }
             }  # A key will be added after this mapping-valued key.
         },
         'dash': {  # This key's value will be unchanged.
             'nothing': 'here'
         }
     }
     source = {
         'line': {
             'properties': {
                 'path': {
                     'new': 'thing'
                 }
             },
             'floperties': {
                 'a': 'flop'
             }
         }
     }
     eq_(
         deep_update(dest, source), {
             'line': {
                 'properties': {
                     'path': {
                         'type': 'string',
                         'index': 'not_analyzed',
                         'new': 'thing'
                     }
                 },
                 'floperties': {
                     'a': 'flop'
                 }
             },
             'dash': {
                 'nothing': 'here'
             }
         })
예제 #3
0
파일: test_utils.py 프로젝트: db48x/dxr
 def test_overwrites(self):
     """Non-mapping keys should be overwritten."""
     eq_(deep_update(dict(a=8), dict(a=9)), dict(a=9))
예제 #4
0
 def test_overwrites(self):
     """Non-mapping keys should be overwritten."""
     eq_(deep_update(dict(a=8), dict(a=9)), dict(a=9))