=== modified file 'VMBuilder/distro.py'
--- VMBuilder/distro.py	2009-06-10 13:40:41 +0000
+++ VMBuilder/distro.py	2009-11-03 11:00:28 +0000
@@ -23,11 +23,11 @@
 class Distro(VMBuilder.plugins.Plugin):
     def has_xen_support(self):
         """Install the distro into destdir"""
-        raise NotImplemented('Distro subclasses need to implement the has_xen_support method')
+        raise NotImplementedError('Distro subclasses need to implement the has_xen_support method')
     
     def install(self, destdir):
         """Install the distro into destdir"""
-        raise NotImplemented('Distro subclasses need to implement the install method')
+        raise NotImplementedError('Distro subclasses need to implement the install method')
 
     def post_mount(self, fs):
         """Called each time a filesystem is mounted to let the distro add things to the filesystem"""

=== modified file 'VMBuilder/hypervisor.py'
--- VMBuilder/hypervisor.py	2009-06-10 13:40:41 +0000
+++ VMBuilder/hypervisor.py	2009-11-03 11:00:28 +0000
@@ -25,5 +25,5 @@
 
 class Hypervisor(VMBuilder.plugins.Plugin):
     def finalize(self):
-        raise NotImplemented('Hypervisor subclasses need to implement the finalize method')
+        raise NotImplementedError('Hypervisor subclasses need to implement the finalize method')
 

=== modified file 'VMBuilder/plugins/ubuntu/suite.py'
--- VMBuilder/plugins/ubuntu/suite.py	2009-06-10 13:40:41 +0000
+++ VMBuilder/plugins/ubuntu/suite.py	2009-11-03 11:00:28 +0000
@@ -31,4 +31,4 @@
 
     def check_arch_validity(self, arch):
         """Checks whether the given arch is valid for this suite"""
-        raise NotImplemented('Suite subclasses need to implement the check_arch_validity method')
+        raise NotImplementedError('Suite subclasses need to implement the check_arch_validity method')

=== modified file 'test/__init__.py'
--- test/__init__.py	2009-10-23 09:27:26 +0000
+++ test/__init__.py	2009-11-03 11:00:28 +0000
@@ -15,3 +15,43 @@
 #
 #    You should have received a copy of the GNU General Public License
 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+import unittest
+
+def interface_implements(iclass, fname, *args, **kwargs):
+    """Creates interface validation test methods.
+    
+    `iclass` - The interface class
+    `fname` - The name of the method that must be implemented
+    `args` and `kwargs` - The required parameters of the method to call
+    
+    >>> import unittest
+    >>> class A:
+    ...     def test(self, x):
+    ...         raise NotImplemented
+    ...
+    >>> class TestA(unittest.TestCase):
+    ...     @interface_implements(A, 'test', None)
+    ...     def test_A_instancesMustImplement_test(self):
+    ...         pass
+    ...
+    >>> unittest.main()
+    """
+    
+    def inner():
+        i = iclass(None)
+        fakeargs = [i]
+        required_f = getattr(i, fname) if hasattr(i, fname) else None
+            
+        import inspect
+        argspec = inspect.formatargspec(*inspect.getargspec(required_f)) if required_f else ''
+        
+        def _wrapper(self):
+            if not hasattr(iclass, fname):
+                self.fail('%s.%s must define a method %s%s that raises NotImplementedError' % (iclass.__module__, iclass.__name__, fname, argspec))            
+
+            self.assertRaises(NotImplementedError, required_f, *args, **kwargs)
+        
+        _wrapper.__doc__ = '%s.%s implementations must implement %s%s' % (iclass.__module__, iclass.__name__, fname, argspec)
+        return _wrapper
+    return inner()

=== added file 'test/distro_tests.py'
--- test/distro_tests.py	1970-01-01 00:00:00 +0000
+++ test/distro_tests.py	2009-11-03 11:00:28 +0000
@@ -0,0 +1,8 @@
+import unittest
+
+from test import interface_implements
+from VMBuilder.distro import Distro
+
+class TestDistro(unittest.TestCase):
+    test_distroImplementationsMustImplementHasXenSupport = interface_implements(Distro, 'has_xen_support')
+    test_distroImplementationsMustImplementInstall = interface_implements(Distro, 'install', None)

=== added file 'test/hypervisor_tests.py'
--- test/hypervisor_tests.py	1970-01-01 00:00:00 +0000
+++ test/hypervisor_tests.py	2009-11-03 11:00:28 +0000
@@ -0,0 +1,7 @@
+import unittest
+
+from test import interface_implements
+from VMBuilder.hypervisor import Hypervisor
+
+class TestDefaultHypervisor(unittest.TestCase):
+    test_defaultFinalizeRaisesNotImplemented = interface_implements(Hypervisor, 'finalize')

=== added file 'test/suite_tests.py'
--- test/suite_tests.py	1970-01-01 00:00:00 +0000
+++ test/suite_tests.py	2009-11-03 11:00:28 +0000
@@ -0,0 +1,7 @@
+import unittest
+
+from test import interface_implements
+from VMBuilder.plugins.ubuntu.suite import Suite
+
+class TestSuite(unittest.TestCase):
+    test_suiteImplementationsMustImplementCheckArchValidity = interface_implements(Suite, 'check_arch_validity', None)

