def test_directories_created_if_they_exist(self, makedirs, isdir, path_exists): makedirs.side_effect = OSError() isdir.return_value = path_exists if path_exists: mkdir_p('path/to/create') makedirs.assert_called_with('path/to/create') else: with pytest.raises(OSError): mkdir_p('path/to/create')
def test_directories_created(self, makedirs): mkdir_p('path/to/create') makedirs.assert_called_with('path/to/create')