def test_find_template_dir_user_dir_first_with_type(isdir, user_path): ret = find_template_dir(tmpl_type='app') assert ret == '/mock/.couchapp/templates/app', ret assert user_path.called assert isdir.called
def f(): find_template_dir(tmpl_type='mock_type')
def test_find_template_dir_user_dir_first(isdir, user_path): ret = find_template_dir() assert ret == '/mock/.couchapp/templates/', ret assert user_path.called assert isdir.called
def test_find_template_dir_not_found(isdir): assert find_template_dir() is None assert isdir.called
def f(): find_template_dir(raise_error=True)