def assertPermissions(): stat_info = os.stat('.') if stat_info.st_uid != os.getuid(): print(utils.lightred("Will not load modules/extensions in tests.")) print(utils.lightred("Repository owner (%d) executer (%d) mismatch" % ( stat_info.st_uid, os.getuid()))) exit(1)
def assertPermissions(): stat_info = os.stat('.') if stat_info.st_uid != os.getuid(): print (utils.lightred("Will not load modules/extensions in tests.")) print (utils.lightred("Repository owner (%d) executer (%d) mismatch" % ( stat_info.st_uid, os.getuid()))) exit(1)
def _execute(self, query): try: result = self.em.query(query) self.assertEqual(result.status.code, 0) return result.response except Exception as e: print("General exception executing query: %s" % (utils.lightred(query))) raise e
def _execute(self, query): try: result = self.em.query(query) self.assertEqual(result.status.code, 0) return result.response except Exception as e: print("General exception executing query: %s (%s)" % (utils.lightred(query), str(e))) raise e
def _execute_set(self, queries): for example in queries: start_time = time.time() result = self._execute(example) end_time = time.time() duration_ms = int((end_time - start_time) * 1000) if duration_ms > 2000: # Query took longer than 2 seconds. duration_ms = utils.lightred(duration_ms) print("Query (%sms): %s, rows: %d" % (duration_ms, example, len(result)))