native_client_sdk/src/tools/tests/create_nmf_test.py
def assertManifestEquals(self, manifest, expected):
    """Compare two manifest dictionaries.

    The input manifest is regenerated with all string keys and values being
    processed through StripSo, to remove the random hexidecimal characters at
    the end of shared object names.

    Args:
      manifest: The generated manifest.
      expected: The expected manifest.
    """
    def StripSoCopyDict(d):
      new_d = {}
      for k, v in d.iteritems():
        new_k = StripSo(k)
        if isinstance(v, (str, unicode)):
          new_v = StripSo(v)
        elif isinstance(v, list):
          new_v = v[:]
        elif isinstance(v, dict):
          new_v = StripSoCopyDict(v)
        else:
          # Assume that anything else can be copied directly.
          new_v = v

        new_d[new_k] = new_v
      return new_d

    strip_manifest = StripSoCopyDict(manifest)
    self.assertEqual(strip_manifest['program'], expected['program'])
    if 'files' in strip_manifest:
      for key in strip_manifest['files']:
        self.assertEqual(strip_manifest['files'][key], expected['files'][key])

    self.assertEqual(strip_manifest, expected)
Compare two manifest dictionaries.

    The input manifest is regenerated with all string keys and values being
    processed through StripSo, to remove the random hexidecimal characters at
    the end of shared object names.

    Args:
      manifest: The generated manifest.
      expected: The expected manifest.
    
Compare two manifest dictionaries.
The input manifest is regenerated with all string keys and values being
processed through StripSo, to remove the random hexidecimal characters at
the end of shared object names.
Compare two manifest dictionaries . The input manifest is regenerated with all string keys and values being processed through StripSo to remove the random hexidecimal characters at the end of shared object names .
def assertManifestEquals(self, manifest, expected):
    def StripSoCopyDict(d):
      new_d = {}
      for k, v in d.iteritems():
        new_k = StripSo(k)
        if isinstance(v, (str, unicode)):
          new_v = StripSo(v)
        elif isinstance(v, list):
          new_v = v[:]
        elif isinstance(v, dict):
          new_v = StripSoCopyDict(v)
        else:
          new_v = v
        new_d[new_k] = new_v
      return new_d
    strip_manifest = StripSoCopyDict(manifest)
    self.assertEqual(strip_manifest['program'], expected['program'])
    if 'files' in strip_manifest:
      for key in strip_manifest['files']:
        self.assertEqual(strip_manifest['files'][key], expected['files'][key])
    self.assertEqual(strip_manifest, expected)
def assertManifestEquals ( self , manifest , expected ) : def StripSoCopyDict ( d ) : new_d = { } for k , v in d . iteritems ( ) : new_k = StripSo ( k ) if isinstance ( v , ( str , unicode ) ) : new_v = StripSo ( v ) elif isinstance ( v , list ) : new_v = v [ : ] elif isinstance ( v , dict ) : new_v = StripSoCopyDict ( v ) else : new_v = v new_d [ new_k ] = new_v return new_d strip_manifest = StripSoCopyDict ( manifest ) self . assertEqual ( strip_manifest [ 'program' ] , expected [ 'program' ] ) if 'files' in strip_manifest : for key in strip_manifest [ 'files' ] : self . assertEqual ( strip_manifest [ 'files' ] [ key ] , expected [ 'files' ] [ key ] ) self . assertEqual ( strip_manifest , expected )
Compare two manifest dictionaries.
Compare two manifest dictionaries .
"""Compare two manifest dictionaries.

    The input manifest is regenerated with all string keys and values being
    processed through StripSo, to remove the random hexidecimal characters at
    the end of shared object names.

    Args:
      manifest: The generated manifest.
      expected: The expected manifest.
    """ # Assume that anything else can be copied directly.
self
manifest
The generated manifest.
The generated manifest .
expected
The expected manifest.
The expected manifest .