def setUp(self): print '%s %s' % (self.id(), self.shortDescription()) self.options = Options(["FileRunner", "+v", "+e", "foo", "bar"], BatchBase.parmDict) self.saveFitGlobal = (FitGlobal.RunOptions, FitGlobal.Options, FitGlobal.Environment) FitGlobal.RunOptions = self.options FitGlobal.Options = self.options FitGlobal.Environment = "Batch" Variations.returnVariation() ## it = getattr(FixtureLoader, "__it__", None) ## if it is not None: ## del FixtureLoader.__it__ self.obj = FixtureLoader() FixtureLoader.clearFixtureRenameTable()
def setUp(self): print '%s %s' % (self.id(), self.shortDescription()) self.options = Options(["FileRunner", "+v", "+e", "foo", "bar"], BatchBase.parmDict) self.saveFitGlobal = (FitGlobal.RunOptions, FitGlobal.Options, FitGlobal.Environment) FitGlobal.RunOptions = self.options FitGlobal.Options = self.options FitGlobal.Environment = "Batch" Variations.returnVariation() ## it = getattr(FixtureLoader, "__it__", None) ## if it is not None: ## del FixtureLoader.__it__ self.obj = FixtureLoader() FixtureLoader.clearFixtureRenameTable()
def setUp(self): print '%s %s' % (self.id(), self.shortDescription()) self.options = Options(["FileRunner", "+v", "+e", "foo", "bar"], BatchBase.parmDict) self.saveFitGlobal = (FitGlobal.RunOptions, FitGlobal.Options, FitGlobal.Environment) self.saveAppExit = (FitGlobal.appConfigModule, FitGlobal.appConfig) FitGlobal.RunOptions = self.options FitGlobal.Options = self.options FitGlobal.Environment = "Batch" FitGlobal.appConfigModule = MockAppConfigMapFixture FitGlobal.appConfig = MockAppConfigMapFixture() Variations.returnVariation() self.obj = FixtureLoader() FixtureLoader.clearFixtureRenameTable()
def setUp(self): print '%s %s' % (self.id(), self.shortDescription()) self.options = Options(["FileRunner", "+v", "+e", "foo", "bar"], BatchBase.parmDict) self.saveFitGlobal = (FitGlobal.RunOptions, FitGlobal.Options, FitGlobal.Environment) self.saveAppExit = (FitGlobal.appConfigModule, FitGlobal.appConfig) FitGlobal.RunOptions = self.options FitGlobal.Options = self.options FitGlobal.Environment = "Batch" FitGlobal.appConfigModule = MockAppConfigMapFixture FitGlobal.appConfig = MockAppConfigMapFixture() Variations.returnVariation() self.obj = FixtureLoader() FixtureLoader.clearFixtureRenameTable()
class Fixture(object): # These labels are in the process of being moved to Variations. # They are still here until several fixtures that use them for # checking are fixed to call FitGlobal.annotationStyleVariation # to do the checking greenColor = "cfffcf" redColor = "ffcfcf" grayColor = "efefef" yellowColor = "ffffcf" labelColor = "c08080" grayLabelColor = "808080" greenLabelColor = "80c080" def __init__(self): # most of these are updated by dependency injection either # in one of the runners or in the recursive invocation in doTables. self.counts = Counts() self.summary = {} self.args = [] self.argCells = [] # self._symbols = {} self.listener = NullFixtureListener() self.fixtureLoader = FixtureLoader() ## Fixture Loader ################################## def loadFixture(self, pathToClass, shouldBeAFixture = True): "load requested fixture - return the class object" result = self.fixtureLoader.loadFixture(pathToClass, shouldBeAFixture) return result # !!! The following are proxy methods which are intended for # use by the runners, the Import fixture and the unit test # suite. They are not general use methods. Either the proxies # or the base methods may be removed at any time. # this is called from the runners and the unit test suite def clearFixtureRenameTable(self): self.fixtureLoader.clearFixtureRenameTable() ## # this is called from the runners to load a table from a file. ## def loadFixtureRenamesFromFile(self, fileName): ## self.fixtureLoader.loadFixtureRenamesFromFile(fileName) ## # this is called from the runners to load a table. ## def loadFixtureRenameTable(self, aList): ## self.fixtureLoader.loadFixtureRenameTable(aList) # this is called from the Import fixture def addRenameToRenameTable(self, alias, originalPath): self.fixtureLoader.addRenameToRenameTable(alias, originalPath) # this is called from the Import fixture def rememberPackage(self, packageName): self.fixtureLoader.rememberPackage(packageName) # this is called from the MiscTest unit tests for Import def clearRememberedPackageTable(self): self.fixtureLoader.clearRememberedPackageTable() # !!! end of internal use proxy methods. ## Major Table Traversal ########################## # First table processing unrolled for doFixture from FitLibrary. # changes copyright 2004 Rick Mugridge, University of Auckland, NZ. # This is only invoked under the first instance of Fixture. It cannot # be overridden by a subclass unless the subclass is invoked at the # top level by runner. def doTables(self, tables): self.listener.tablesStarted(tables) self.summary["run date"] = time.ctime(time.time()) self.summary["run elapsed time"] = RunTime() Variations.returnVariation() if tables.tag.lower() == "<wiki>": tables = tables.parts # Rick's unrolled process begins here... if tables is not None: heading = self.fixtureName(tables) if heading is not None: try: fixture = self.getLinkedFixtureWithArgs(tables) fixture.interpretTables(tables) except Exception, e: self.exception(heading, e) self.listener.tableFinished(tables) self._interpretFollowingTables(tables)
def tearDown(self): FixtureLoader.clearFixtureRenameTable() FitGlobal.RunOptions, FitGlobal.Options, FitGlobal.Environment = \ self.saveFitGlobal FitGlobal.appConfigModule, FitGlobal.appConfig = self.saveAppExit
def tearDown(self): FixtureLoader.clearFixtureRenameTable() FitGlobal.RunOptions, FitGlobal.Options, FitGlobal.Environment = \ self.saveFitGlobal
class Fixture(object): # These labels are in the process of being moved to Variations. # They are still here until several fixtures that use them for # checking are fixed to call FitGlobal.annotationStyleVariation # to do the checking greenColor = "cfffcf" redColor = "ffcfcf" grayColor = "efefef" yellowColor = "ffffcf" labelColor = "c08080" grayLabelColor = "808080" greenLabelColor = "80c080" def __init__(self): # most of these are updated by dependency injection either # in one of the runners or in the recursive invocation in doTables. self.counts = Counts() self.summary = {} self.args = [] self.argCells = [] # self._symbols = {} self.listener = NullFixtureListener() self.fixtureLoader = FixtureLoader() ## Fixture Loader ################################## def loadFixture(self, pathToClass, shouldBeAFixture=True): "load requested fixture - return the class object" result = self.fixtureLoader.loadFixture(pathToClass, shouldBeAFixture) return result # !!! The following are proxy methods which are intended for # use by the runners, the Import fixture and the unit test # suite. They are not general use methods. Either the proxies # or the base methods may be removed at any time. # this is called from the runners and the unit test suite def clearFixtureRenameTable(self): self.fixtureLoader.clearFixtureRenameTable() ## # this is called from the runners to load a table from a file. ## def loadFixtureRenamesFromFile(self, fileName): ## self.fixtureLoader.loadFixtureRenamesFromFile(fileName) ## # this is called from the runners to load a table. ## def loadFixtureRenameTable(self, aList): ## self.fixtureLoader.loadFixtureRenameTable(aList) # this is called from the Import fixture def addRenameToRenameTable(self, alias, originalPath): self.fixtureLoader.addRenameToRenameTable(alias, originalPath) # this is called from the Import fixture def rememberPackage(self, packageName): self.fixtureLoader.rememberPackage(packageName) # this is called from the MiscTest unit tests for Import def clearRememberedPackageTable(self): self.fixtureLoader.clearRememberedPackageTable() # !!! end of internal use proxy methods. ## Major Table Traversal ########################## # First table processing unrolled for doFixture from FitLibrary. # changes copyright 2004 Rick Mugridge, University of Auckland, NZ. # This is only invoked under the first instance of Fixture. It cannot # be overridden by a subclass unless the subclass is invoked at the # top level by runner. def doTables(self, tables): self.listener.tablesStarted(tables) self.summary["run date"] = time.ctime(time.time()) self.summary["run elapsed time"] = RunTime() Variations.returnVariation() if tables.tag.lower() == "<wiki>": tables = tables.parts # Rick's unrolled process begins here... if tables is not None: heading = self.fixtureName(tables) if heading is not None: try: fixture = self.getLinkedFixtureWithArgs(tables) fixture.interpretTables(tables) except Exception, e: self.exception(heading, e) self.listener.tableFinished(tables) self._interpretFollowingTables(tables)
def tearDown(self): FixtureLoader.clearFixtureRenameTable() FitGlobal.RunOptions, FitGlobal.Options, FitGlobal.Environment = \ self.saveFitGlobal FitGlobal.appConfigModule, FitGlobal.appConfig = self.saveAppExit
def tearDown(self): FixtureLoader.clearFixtureRenameTable() FitGlobal.RunOptions, FitGlobal.Options, FitGlobal.Environment = \ self.saveFitGlobal