class _ApplicationUiSettingsForm(formencode.Schema): allow_extra_fields = True filter_extra_fields = False paths_root_path = All( v.ValidPath(), v.UnicodeString(strip=True, min=1, not_empty=True)) hooks_changegroup_update = v.StringBoolean(if_missing=False) hooks_changegroup_repo_size = v.StringBoolean(if_missing=False) extensions_largefiles = v.StringBoolean(if_missing=False) extensions_hgsubversion = v.StringBoolean(if_missing=False) extensions_hggit = v.StringBoolean(if_missing=False)
def test_ValidPath(self): validator = v.ValidPath() assert base.TESTS_TMP_PATH == validator.to_python(base.TESTS_TMP_PATH) with pytest.raises(formencode.Invalid): validator.to_python('/no_such_dir')
def test_ValidPath(self): validator = v.ValidPath() self.assertEqual(TESTS_TMP_PATH, validator.to_python(TESTS_TMP_PATH)) self.assertRaises(formencode.Invalid, validator.to_python, '/no_such_dir')