def find_cases(test_names, test_dir): found = set() tests_list = [] dir_list = os.listdir(test_dir) if allscrewedup : print "ENTERING find_cases " + str(test_names) + " DIR " + str(test_dir) filtered_dir_list = set() if not test_names: test_names = ['*',] for name_pattern in test_names: matches = fnmatch.filter(dir_list, name_pattern + ".py") if matches: for match in matches: if os.path.isfile(os.path.join(test_dir, match)): filtered_dir_list.add(match) for entry in filtered_dir_list: # conditions for ignoring files if not entry.endswith('.py'): continue if entry.startswith('_'): continue found.add(entry) tests_list.append(entry) BaseTestCase.process_test_list(tests_list) return found
def init(self, ns_app_name, object_type, action): self.app_name = self.__class__.__name__ m = importlib.import_module("apps.native.%s.%sConfig" % (self.app_name.lower(), self.app_name)) for item in dir(m): if not item.startswith("__"): value = getattr(m,item) self.__dict__[item] = value BaseTestCase.init(self, ns_app_name, object_type, action) self.track["START_TSTMP"] = time.time()
def end(self, test_run_id, result, exc, trace): self.track["END_TSTMP"] = time.time() BaseTestCase.end(self, test_run_id, result, exc, trace)
def end(self, test_run_id, result, exc, trace): self.track["END_TSTMP"] = time.time() self.browser_killer.kill = True BaseTestCase.end(self, test_run_id, result, exc, trace)