def __init__(self, *args, **dargs): """ Initialize new subtest, passes all arguments through to parent class """ super(Subtest, self).__init__(*args, **dargs) # log indentation level not easy to get at, so use opaque implementation _si = job.status_indenter(self.job) _sl = base_job.status_logger(self.job, _si) self._re = _sl.render_entry # will return string w/ proper indentation # So tests don't need to set this up every time config_parser = config.Config() self.config = config_parser.get(self.config_section) if self.config is None: logging.warning("No configuration section found '%s'", self.config_section) self.config = config_parser['DEFAULTS'] # Mark this to not be checked, no config, no version info. self.config['config_version'] = version.NOVERSIONCHECK self.version = 0 else: # Version number used by one-time setup() test.test method self.version = version.str2int(self.config['config_version']) # Fail test if configuration being used doesn't match dockertest API version.check_version(self.config) # Log original key/values before subtest could modify them self.write_test_keyval(self.config) # Optionally setup different iterations if option exists self.iterations = self.config.get('iterations', self.iterations) # subclasses can do whatever they like with this self.stuff = {}
def main(): version.check_version() if len(sys.argv) < 2 or sys.argv[1] in HELP_SYNONYMS: if len(sys.argv) >= 3: showcommandhelp(sys.argv[2]) else: showhelp() else: runcommand(sys.argv[1], sys.argv[2:])
def main(): version.check_version() if len(sys.argv) < 2 or sys.argv[1] in HELP_SYNONYMS: if len(sys.argv) >= 3: showcommandhelp(sys.argv[2]) else: showhelp() else: runcommand(sys.argv[1], sys.argv[2:])
def initialize(self): super(Subtest, self).initialize() # Fail test if autotest is too old version.check_autotest_version(self.config, get_version()) # Fail test if configuration being used doesn't match dockertest API version.check_version(self.config) msg = "Subtest %s configuration:\n" % self.__class__.__name__ for key, value in self.config.items(): msg += '\t\t%s = "%s"\n' % (key, value) self.logdebug(msg)
def initialize(self): super(Subtest, self).initialize() # Fail test if autotest is too old version.check_autotest_version(self.config, get_version()) # Fail test if configuration being used doesn't match dockertest API version.check_version(self.config) # Fail test if dockertest API does not match documentation version version.check_doc_version() # These two are unique to subtest & runtime state self.step_log_msgs['setup'] = ("setup() for subtest version %s" % self.version) self.step_log_msgs['postprocess_iteration'] = ( "postprocess_iteration() #%d of #%d" % (self.iteration, self.iterations))
def initialize(self): super(Subtest, self).initialize() # Fail test if autotest is too old version.check_autotest_version(self.config, get_version()) # Fail test if configuration being used doesn't match dockertest API version.check_version(self.config) # Fail test if dockertest API does not match documentation version version.check_doc_version() # These two are unique to subtest & runtime state self.step_log_msgs['setup'] = ("setup() for subtest version %s" % self.version) self.step_log_msgs['postprocess_iteration'] = ( "postprocess_iteration() #%d of #%d" % (self.iteration, self.iterations))
def __init__(self, teams_file: str): if not os.path.exists(teams_file): raise FileNotFoundError( '{} was not found. Please provide the full path.'.format( teams_file)) if not teams_file.lower().endswith('.xlsx'): raise IOError( '{} is not supported. Only Excel (*.xlsx) files are supported: use the correct template "Teilnehmerliste.xlsx".' .format(teams_file)) teams_wb = load_workbook(teams_file) version_string = teams_wb.active["N4"].value check_version(version_string) self._teams_wb = teams_wb self.teams = self._load() self._teams_wb.close()
def startup(self): import version version.check_version() import database self.db = database.Database() import store self.store = store.Store() import person self.person = person.Person() self.person.setup() import base_win self.base_win = base_win.BaseWin(self) self.base_win.show()
def initialize(self): super(Subtest, self).initialize() # Fail test if autotest is too old version.check_autotest_version(self.config, get_version()) # Fail test if configuration being used doesn't match dockertest API version.check_version(self.config) # Fail test if dockertest API does not match documentation version version.check_doc_version() # These two are unique to subtest & runtime state self.step_log_msgs['setup'] = ("setup() for subtest version %s" % self.version) self.step_log_msgs['postprocess_iteration'] = ( "postprocess_iteration() #%d of #%d" % (self.iteration, self.iterations)) if self.config.get('verify_enforcing', True): self.failif( not selinux_is_enforcing(), "SELinux mode != Enforcing and" " verify_enforcing is set")
def initialize(self): super(Subtest, self).initialize() # Fail test if autotest is too old version.check_autotest_version(self.config, get_version()) # Fail test if configuration being used doesn't match dockertest API version.check_version(self.config) # Fail test if dockertest API does not match documentation version version.check_doc_version() # These two are unique to subtest & runtime state self.step_log_msgs['setup'] = ("setup() for subtest version %s" % self.version) self.step_log_msgs['postprocess_iteration'] = ( "postprocess_iteration() #%d of #%d" % (self.iteration, self.iterations)) if self.config.get('verify_enforcing', True): self.failif(not selinux_is_enforcing(), "SELinux mode != Enforcing and" " verify_enforcing is set")
if chgdst: dst = self.fileopener.dstfolderpath.get() mkdir = self.fileopener.allow_mkdir.get() == 1 cc = CimConverter(is_to_png, is_single, src, dst, mkdir) else: cc = CimConverter(is_to_png, is_single, src) if is_single: res = cc.execute() self.log.insert(tk.END, res['message'] + '\n', res['status']) else: for res in cc.execute(): self.log.insert(tk.END, res['message'] + '\n', res['status']) except PathError as e: self.log.insert(tk.END, str(e) + '\n', 'error') self.log.see(tk.END) self.log.configure(state=tk.DISABLED) root = tk.Tk() root.geometry('800x600') root.title('CIM Conversion Tool') root.tk.call('wm', 'iconphoto', root._w, tk.PhotoImage(data=icon_base64)) # version check release = check_version() app = Application(root, latest_ver=release) app.mainloop()