Skip to content

Commit

Permalink
[#1841] fix tests, pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Aug 14, 2014
1 parent e6d2c46 commit 878be66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ckanext/example_ivalidators_iconverters/plugin.py
@@ -1,6 +1,7 @@
from ckan.plugins import toolkit
from ckan import plugins


class ExampleIValidatorsPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IValidators)

Expand All @@ -18,6 +19,7 @@ def get_converters(self):
'negate': negate,
}


def equals_fortytwo(value):
if value != 42:
raise toolkit.Invalid('not 42')
Expand Down
Expand Up @@ -2,13 +2,15 @@
import pylons.config as config

from ckan.plugins import toolkit
from ckan.logic import clear_converters_cache, clear_validators_cache
from ckan import plugins


class TestIValidators(object):
@classmethod
def setup_class(cls):
plugins.load('example_ivalidators')
clear_validators_cache()

@classmethod
def teardown_class(cls):
Expand All @@ -27,6 +29,7 @@ class TestIConverters(object):
@classmethod
def setup_class(cls):
plugins.load('example_iconverters')
clear_converters_cache()

@classmethod
def teardown_class(cls):
Expand All @@ -35,4 +38,3 @@ def teardown_class(cls):
def test_custom_converter_converts(self):
c = toolkit.get_converter('negate')
assert_equals(c(19), -19)

0 comments on commit 878be66

Please sign in to comment.