def testGclientRootInParentDir_NotInGclientEntries(self): self.make_file_tree({ '.gclient': '', '.gclient_entries': 'entries = {"foo": "..."}', }) self.assertIsNone( gclient_paths.FindGclientRoot(os.path.join(self.root, 'bar', 'baz')))
def testGclientRootInParentDir(self): self.make_file_tree({ '.gclient': '', '.gclient_entries': 'entries = {"foo": "..."}', }) self.assertEqual( self.root, gclient_paths.FindGclientRoot(os.path.join(self.root, 'foo', 'bar')))
def testGclientRootInParentDir_NoGclientEntriesFile(self): self.make_file_tree({'.gclient': ''}) self.assertEqual( self.root, gclient_paths.FindGclientRoot(os.path.join(self.root, 'x', 'y', 'z'))) self.assertEqual( '%s missing, .gclient file in parent directory %s might not be the ' 'file you want to use.\n' % ( os.path.join(self.root, '.gclient_entries'), self.root), sys.stderr.getvalue())
def testRootNotFound(self): self.assertIsNone( gclient_paths.FindGclientRoot(os.path.join(self.root, 'x', 'y', 'z')))
def testGclientRootInParentDir_ErrorWhenParsingEntries(self): self.make_file_tree({'.gclient': '', '.gclient_entries': ':P'}) with self.assertRaises(Exception): gclient_paths.FindGclientRoot(os.path.join(self.root, 'foo', 'bar'))
def testFindGclientRoot(self): self.make_file_tree({'.gclient': ''}) self.assertEqual(self.root, gclient_paths.FindGclientRoot(self.root))