Beispiel #1
0
 def testExceptionIfNoBuildGnFilesAreFound(self):
     with self.assertRaises(check_orphan_headers.NoBuildGnFoundError):
         file_path = _GetPath('home', 'projects', 'webrtc', 'base', 'foo.h')
         file_exists = lambda p: False
         src_dir_path = _GetPath('home', 'projects', 'webrtc')
         check_orphan_headers.GetBuildGnPathFromFilePath(
             file_path, file_exists, src_dir_path)
Beispiel #2
0
 def testExceptionIfFilePathIsNotAnHeader(self):
     with self.assertRaises(check_orphan_headers.WrongFileTypeError):
         file_path = _GetPath('home', 'projects', 'webrtc', 'base',
                              'foo.cc')
         file_exists = lambda p: False
         src_dir_path = _GetPath('home', 'projects', 'webrtc')
         check_orphan_headers.GetBuildGnPathFromFilePath(
             file_path, file_exists, src_dir_path)
Beispiel #3
0
 def testGetBuildPathFromParentDirectory(self):
     file_path = _GetPath('home', 'projects', 'webrtc', 'base', 'foo.h')
     expected_build_path = _GetPath('home', 'projects', 'webrtc',
                                    'BUILD.gn')
     file_exists = lambda p: p == _GetPath('home', 'projects', 'webrtc',
                                           'BUILD.gn')
     src_dir_path = _GetPath('home', 'projects', 'webrtc')
     self.assertEqual(
         expected_build_path,
         check_orphan_headers.GetBuildGnPathFromFilePath(
             file_path, file_exists, src_dir_path))