view tests/test_path.py @ 18:56596902e9ae default tip

add some setup + tests
author Jeff Hammel <k0scist@gmail.com>
date Sun, 10 Dec 2017 17:57:03 -0800
parents
children
line wrap: on
line source

import os
from lemuriformes.path import TempDir


def test_tempdir_contextmanager():
    """
    ensure our temporary directory contextmanager works
    and does what we want it to
    """

    tmpdir = None
    with TempDir() as td:
        tmpdir = td
        assert os.path.exists(tmpdir)
        assert os.path.isdir(tmpdir)
    assert not os.path.exists(tmpdir)
    assert not os.path.isdir(tmpdir)