コード例 #1
0
ファイル: test_io.py プロジェクト: shaohuizhang/aneris
def test_nondefault_rc():
    rcstr = """
    config:
        cov_threshold: 42
    """

    obs = _io.RunControl(rcstr)
    exp = _defaults
    exp['config']['cov_threshold'] = 42
    assert exp == obs
コード例 #2
0
ファイル: test_io.py プロジェクト: shaohuizhang/aneris
def test_recursive_update():
    update = {
        'foo': 'bar',
        'cov_threshold': 42,
    }
    exp = _defaults
    exp['config'].update(update)

    obs = _io.RunControl()
    obs.recursive_update('config', update)
    assert obs == exp
コード例 #3
0
ファイル: test_io.py プロジェクト: shaohuizhang/aneris
def test_nondefault_rc_file_read():
    rcstr = b"""
    config:
        cov_threshold: 42
    """
    with tempfile.NamedTemporaryFile(delete=False) as f:
        f.write(rcstr)
        f.flush()
        obs = _io.RunControl(f.name)
        exp = _defaults
        exp['config']['cov_threshold'] = 42
        assert exp == obs
コード例 #4
0
ファイル: test_io.py プロジェクト: shaohuizhang/aneris
def test_mutable():
    obs = _io.RunControl()
    with pytest.raises(TypeError):
        obs['foo'] = 'bar'
コード例 #5
0
ファイル: test_io.py プロジェクト: shaohuizhang/aneris
def test_default_rc():
    exp = _defaults
    obs = _io.RunControl()
    assert obs == exp