Exemplo n.º 1
0
  def testReadFirstIdsFromFile(self):
    test_resource_ids = os.path.join(os.path.dirname(__file__), '..',
                                     'testdata', 'resource_ids')
    base_dir = os.path.dirname(test_resource_ids)

    src_dir, id_dict = misc._ReadFirstIdsFromFile(
        test_resource_ids,
        {
          'FOO': os.path.join(base_dir, 'bar'),
          'SHARED_INTERMEDIATE_DIR': os.path.join(base_dir,
                                                  'out/Release/obj/gen'),
        })
    self.assertEqual({}, id_dict.get('bar/file.grd', None))
    self.assertEqual({},
        id_dict.get('out/Release/obj/gen/devtools/devtools.grd', None))

    src_dir, id_dict = misc._ReadFirstIdsFromFile(
        test_resource_ids,
        {
          'SHARED_INTERMEDIATE_DIR': '/outside/src_dir',
        })
    # Windows adds a c:// prefix, which is why this is needed here.
    abs_path = os.path.abspath(
        '/outside/src_dir/devtools/devtools.grd').replace('\\', '/')
    self.assertEqual({}, id_dict.get(abs_path, None))
Exemplo n.º 2
0
 def testReadFirstIdsFromFile(self):
   test_resource_ids = os.path.join(os.path.dirname(__file__), '..',
                                    'testdata', 'resource_ids')
   src_dir, id_dict = misc._ReadFirstIdsFromFile(
       test_resource_ids,
       {
         'FOO': '/bar',
         'SHARED_INTERMEDIATE_DIR': '/out/Release/obj/gen',
       })
   self.assertEqual({}, id_dict.get('bar/file.grd', None))
   self.assertEqual({},
       id_dict.get('out/Release/obj/gen/devtools/devtools.grd', None))