def testCustomFlags(): # add cli properties to current execution sys.argv.append("--foo=defaultname=abc") sys.argv.append("-X defaultname=def") loader = CommandLineConfigurationLoader('--foo') nt.eq_(True, loader.isLoadable()) nt.eq_('abc', loader.loadConfiguration().get('defaultname')) loader = CommandLineConfigurationLoader('-X') nt.eq_(True, loader.isLoadable()) nt.eq_('def', loader.loadConfiguration().get('defaultname'))
def testUnLoadable(): loader = CommandLineConfigurationLoader() nt.assert_false(loader.isLoadable(), msg='Expected a non-loadable CLI loader')