test: file cache directory exists
Improve FileCache test for creating the cache directory.

I wanted to fix up two issues here.

 1. We are catching the exceptions on python 2.x and 3.x.
 2. The test clearly specifies what is happening

The previous test was slightly confusing as it created some cache
directory manually and didn't assert a result. It just would assert
False when there was an error.

I think this is a little clearer.

This also updates the tests use pytest's tmpdir fixture[0], which cleans
up after itself.

[0] http://pytest.org/latest/tmpdir.html