示例#1
0
文件: test_util.py 项目: jloehel/xii
def test_yaml_read_ioerror(monkeypatch):

    monkeypatch.setattr("__builtin__.open", fake_invalid_open())
    
    with raises(error.ConnError):
        util.yaml_read("/tmp/yaml")
示例#2
0
文件: test_util.py 项目: jloehel/xii
def test_file_read_invalid(monkeypatch):
    monkeypatch.setattr("os.open", fake_invalid_open())

    with raises(error.NotFound):
        util.file_read("/invalid/directory/file")