test_lsdi.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:emory-baggins 作者: emory-libraries 项目源码 文件源码
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'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号