def testGetOverlayNameProfilesLayoutConfNoRepoName(self): """Verify metadata/layout.conf w/out repo-name is ignored""" self._CreateProfilesRepoName('hi!') metadata = os.path.join(self.tempdir, 'metadata') osutils.SafeMakedirs(metadata) layout_conf = os.path.join(metadata, 'layout.conf') osutils.WriteFile(layout_conf, 'here = we go') self.assertEqual(portage_util.GetOverlayName(self.tempdir), 'hi!')
def testGetOverlayNameProfilesLayoutConf(self): """Verify metadata/layout.conf is read before profiles/repo_name""" self._CreateProfilesRepoName('hi!') metadata = os.path.join(self.tempdir, 'metadata') osutils.SafeMakedirs(metadata) layout_conf = os.path.join(metadata, 'layout.conf') osutils.WriteFile(layout_conf, 'repo-name = bye') self.assertEqual(portage_util.GetOverlayName(self.tempdir), 'bye')
def testGetOverlayNameProfilesRepoName(self): """Verify profiles/repo_name can be read""" self._CreateProfilesRepoName('hi!') self.assertEqual(portage_util.GetOverlayName(self.tempdir), 'hi!')
def testGetOverlayNameNone(self): """If the overlay has no name, it should be fine""" self.assertEqual(portage_util.GetOverlayName(self.tempdir), None)