def test_handle_missing_config_directory(self): """Create the config directory if it does not exist.""" self.filesystem.remove_empty_directory(self.locator.root) self.run_cli(["-l", "foo", "-i", "bar", "--persist"]) contents = _load_config( filesystem=self.filesystem, locator=self.locator, ) self.assertEqual( contents, {'virtualenv': {"bar": {"install": ["bar"], "link": ["foo"]}}} ) def fake_create(self, virtualenv, **kwargs): try: self.filesystem.create_directory(path=virtualenv.path) except FileExists: pass File "/home/user/Documents/venvs/venvs/tests/utils.py", line 61, in fake_create self.filesystem.create_directory(path=virtualenv.path) File "/home/user/Documents/venvs/venv/lib/python3.6/site-packages/filesystems/memory.py", line 187, in lambda fs, *args, **kw: fs._state.create_directory(*args, **kw) File "/home/user/Documents/venvs/venv/lib/python3.6/site-packages/filesystems/memory.py", line 93, in create_directory raise exceptions.FileNotFound(parent) filesystems.exceptions.FileNotFound: No such file or directory: /virtualenvs