def setUp(self): self.workdirectory = os.path.dirname(os.path.realpath(__file__)) # reset global shell variables shell.logcommands = False shell.encoding = None configuration.setconfigfile(None) configuration.setUser(None) configuration.setPassword(None)
def parsecommandline(): parser = argparse.ArgumentParser() configfiledefault = 'config.ini' configfilehelp = 'name of the config file, or full path to the config file; defaults to ' + configfiledefault parser.add_argument('-c', '--configfile', metavar='file', dest='configfile', help=configfilehelp, default=configfiledefault) parser.add_argument('-u', '--user', metavar='user', dest='user', help='RTC user', default=None) parser.add_argument('-p', '--password', metavar='password', dest='password', help='RTC password', default=None) arguments = parser.parse_args() configuration.setconfigfile(arguments.configfile) configuration.setUser(arguments.user) configuration.setPassword(arguments.password)
def parsecommandline(): parser = argparse.ArgumentParser() configfiledefault = 'config.ini' configfilehelp = 'name of the config file, or full path to the config file; defaults to ' + configfiledefault parser.add_argument('-c', '--configfile', metavar='file', dest='configfile', help=configfilehelp, default=configfiledefault) parser.add_argument('-u', '--user', metavar='user', dest='user', help='RTC user', default=None) parser.add_argument('-p', '--password', metavar='password', dest='password', help='RTC password', default=None) parser.add_argument('-s', '--stored', help='Use stored password for the repository connection', action='store_true') arguments = parser.parse_args() configuration.setconfigfile(arguments.configfile) configuration.setUser(arguments.user) configuration.setPassword(arguments.password) configuration.setStored(arguments.stored)
def test_read_passedin_configfile_expect_override_user_password(self): configuration.setUser('newUser') configuration.setPassword('newPassword') self._assertTestConfig(configuration.read(testhelper.getrelativefilename('resources/test_config.ini')), user='******', password='******')