def testUseOwnDb(self): # We can pass our own database to loadInstalled to cause its behavior # to differ from the original expected behavior a bit. # rMake uses this to fiddle w/ the troves that match a hostname/label # request. repos = self.openRepository() cfg = copy.copy(self.cfg) branch = versions.VersionFromString('/localhost@rpl:devel//shadow/') db = trovesource.SimpleTroveSource() self.addTestPkg(1, version='1.0') test2Recipe = recipes.createRecipe(2, version='1.0', header='loadInstalled("test1")') cfg.buildLabel = versions.Label('localhost@rpl:branch') cfg.installLabelPath = [cfg.buildLabel] self.addComponent('test2:source', '/localhost@rpl:branch/1.0', [('test2.recipe', test2Recipe)]) try: loader = self._testSubload(repos, "loadSuperClass('test2')", cfg=cfg, branch=branch) assert (0) except Exception, err: assert (str(err).find('cannot find source component test1:source:') != -1) pass
def testUseInstallLabelPath(self): repos = self.openRepository() branch = versions.VersionFromString('/localhost@rpl:devel//shadow/') self.addTestPkg(1, version='1.0') test2Recipe = recipes.createRecipe(2, version='1.0', header='loadSuperClass("test1")') cfg = copy.copy(self.cfg) cfg.buildLabel = versions.Label('localhost@rpl:branch') cfg.installLabelPath = [versions.Label('localhost@rpl:branch')] self.addComponent('test2:source', '/localhost@rpl:branch/1.0', [('test2.recipe', test2Recipe)]) try: self._testSubload(repos, "loadSuperClass('test2')", branch = branch, cfg = cfg) assert(0) except Exception, err: assert(str(err).find('cannot find source component test1:source:') != -1) pass
def testUseOwnDb(self): # We can pass our own database to loadInstalled to cause its behavior # to differ from the original expected behavior a bit. # rMake uses this to fiddle w/ the troves that match a hostname/label # request. repos = self.openRepository() cfg = copy.copy(self.cfg) branch = versions.VersionFromString('/localhost@rpl:devel//shadow/') db = trovesource.SimpleTroveSource() self.addTestPkg(1, version='1.0') test2Recipe = recipes.createRecipe(2, version='1.0', header='loadInstalled("test1")') cfg.buildLabel = versions.Label('localhost@rpl:branch') cfg.installLabelPath = [cfg.buildLabel] self.addComponent('test2:source', '/localhost@rpl:branch/1.0', [('test2.recipe', test2Recipe)]) try: loader = self._testSubload(repos, "loadSuperClass('test2')", cfg = cfg, branch = branch) assert(0) except Exception, err: assert(str(err).find('cannot find source component test1:source:') != -1) pass
def testUseInstallLabelPath(self): repos = self.openRepository() branch = versions.VersionFromString('/localhost@rpl:devel//shadow/') self.addTestPkg(1, version='1.0') test2Recipe = recipes.createRecipe(2, version='1.0', header='loadSuperClass("test1")') cfg = copy.copy(self.cfg) cfg.buildLabel = versions.Label('localhost@rpl:branch') cfg.installLabelPath = [versions.Label('localhost@rpl:branch')] self.addComponent('test2:source', '/localhost@rpl:branch/1.0', [('test2.recipe', test2Recipe)]) try: self._testSubload(repos, "loadSuperClass('test2')", branch=branch, cfg=cfg) assert (0) except Exception, err: assert (str(err).find('cannot find source component test1:source:') != -1) pass