# vim: set filencoding=utf8 """ Implements Decorator Tests @author: Mike Crute (mcrute@gmail.com) @organization: SoftGroup Interactive, Inc. @date: May 02, 2010 """ from foundry.utils import implements from nose.tools import raises class MyInterface(object): def get(self, foo): pass def set(self, bar, baz=None): pass def remove(self, *args, **kwargs): pass def test_conforming_should_not_fail(): @implements(MyInterface, debug=True) class Conforming(object): def get(self, foo): pass def set(self, bar, baz=None): pass def remove(self, *args, **kwargs): pass @raises(AssertionError) def test_non_conforming_should_fail(): @implements(MyInterface, debug=True) class NonConforming(object): pass def test_non_debug_should_do_nothing(): @implements(MyInterface) class NonConforming(object): pass