def test_load_configfile_valid(self):
lbag = LsdiBagger()
# use a Mock to simulate argparse options
lbag.options = Mock(item_ids=[], gen_config=False, digwf_url=None,
output=None)
# load fixture that should work
lbag.options.config = os.path.join(FIXTURE_DIR, 'lsdi-bagger.cfg')
lbag.load_configfile()
# value from the config fixture
assert lbag.options.digwf_url == 'http://example.co:3100/digwf_api/'
assert lbag.options.output == '/tmp/bags'
assert lbag.options.fedora_url == 'http://server.edu:8080/fedora/'
# if output is specified on command line, that takes precedence
lbag.options.output = '/i/want/bags/somewhere/else'
lbag.load_configfile()
assert lbag.options.output != '/tmp/bags'
评论列表
文章目录