def _fill_DataTestCase(): data_dir = abspath(join(dirname(__file__), "textinfo_data")) for ti_path in testsupport.paths_from_path_patterns([data_dir], recursive=True, includes=["*.textinfo"]): try: info = simplejson.loads(open(ti_path, 'rb').read()) except ValueError, ex: raise TestError("error reading JSON in `%s': %s" % (ti_path, ex)) data_path = testsupport.relpath(splitext(ti_path)[0], os.getcwd()) # Tags. tags = [] tags_path = data_path + ".tags" if exists(tags_path): for line in open(tags_path): if "#" in line: line = line[:line.index('#')].strip() tags += line.split() # Options. opts = {} opts_path = data_path + ".opts" if exists(opts_path): try: opts = simplejson.loads(open(opts_path, 'rb').read()) except ValueError, ex: raise TestError("error reading JSON in `%s': %s" % (opts_path, ex)) # The names of keyword args for a function call must be # strings. opts = dict((str(k), v) for k,v in opts.items())
def _fill_DataTestCase(): data_dir = abspath(join(dirname(__file__), "textinfo_data")) for ti_path in testsupport.paths_from_path_patterns( [data_dir], recursive=True, includes=["*.textinfo"]): try: info = simplejson.loads(open(ti_path, 'rb').read()) except ValueError, ex: raise TestError("error reading JSON in `%s': %s" % (ti_path, ex)) data_path = testsupport.relpath(splitext(ti_path)[0], os.getcwd()) # Tags. tags = [] tags_path = data_path + ".tags" if exists(tags_path): for line in open(tags_path): if "#" in line: line = line[:line.index('#')].strip() tags += line.split() # Options. opts = {} opts_path = data_path + ".opts" if exists(opts_path): try: opts = simplejson.loads(open(opts_path, 'rb').read()) except ValueError, ex: raise TestError("error reading JSON in `%s': %s" % (opts_path, ex)) # The names of keyword args for a function call must be # strings. opts = dict((str(k), v) for k, v in opts.items())
def test_paths(): """Generate the potential JS test files.""" self_dir = dirname(abspath(__file__)) komodo_src_dir = dirname(dirname(self_dir)) komodo_chrome_dir = join(komodo_src_dir, "src", "chrome", "komodo", "content") for path in paths_from_path_patterns([komodo_chrome_dir, self_dir], includes=["test_*.jsm"]): yield path
def test_paths(): """Generate the potential JS test files.""" catman = components.classes["@mozilla.org/categorymanager;1"]\ .getService(components.interfaces.nsICategoryManager) cat_enum = catman.enumerateCategory("komodo-jstest-paths") dirs = [] while cat_enum.hasMoreElements(): entry = cat_enum.getNext() value = catman.getCategoryEntry("komodo-jstest-paths", str(entry)) dirs.append(abspath(value)) for path in paths_from_path_patterns(dirs, includes=["test_*.jsm"]): yield path