Skip to content

Instantly share code, notes, and snippets.

@ahal
Last active July 12, 2018 15:07
Show Gist options
  • Save ahal/a0177e571815471aafe93ff70960574b to your computer and use it in GitHub Desktop.
Save ahal/a0177e571815471aafe93ff70960574b to your computer and use it in GitHub Desktop.
misc
def getTestManifest(self, options):
if isinstance(options.manifestFile, TestManifest):
manifest = options.manifestFile
elif options.manifestFile and os.path.isfile(options.manifestFile):
manifestFileAbs = os.path.abspath(options.manifestFile)
assert manifestFileAbs.startswith(SCRIPT_DIR)
manifest = TestManifest([options.manifestFile], strict=False)
elif (options.manifestFile and
os.path.isfile(os.path.join(SCRIPT_DIR, options.manifestFile))):
manifestFileAbs = os.path.abspath(
os.path.join(
SCRIPT_DIR,
options.manifestFile))
assert manifestFileAbs.startswith(SCRIPT_DIR)
manifest = TestManifest([manifestFileAbs], strict=False)
else:
masterName = self.normflavor(options.flavor) + '.ini'
masterPath = os.path.join(SCRIPT_DIR, self.testRoot, masterName)
if os.path.exists(masterPath):
manifest = TestManifest([masterPath], strict=False)
else:
manifest = None
self.log.warning(
'TestManifest masterPath %s does not exist' %
masterPath)
return manifest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment