Ejemplo n.º 1
0
def test_handler_existing_file():
    handler = FakeHandler([])
    file_info = os.stat(__file__)
    with handler.parent_open(__file__) as f_obj:
        assert (os.fstat(f_obj.fileno()).st_ino ==
                file_info.st_ino)
        assert f_obj.name == __file__
Ejemplo n.º 2
0
def test_handler_missing_file():
    handler = FakeHandler([])
    assert handler.parent_open("does_not_exist") is None