Mercurial > hg > Lemuriformes
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test_path.py Sun Dec 10 17:57:03 2017 -0800 @@ -0,0 +1,18 @@ +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) +