~ubuntu-branches/ubuntu/maverick/python3.1/maverick

« back to all changes in this revision

Viewing changes to Lib/importlib/test/test_abc.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-03-23 00:01:27 UTC
  • Revision ID: james.westby@ubuntu.com-20090323000127-5fstfxju4ufrhthq
Tags: upstream-3.1~a1+20090322
ImportĀ upstreamĀ versionĀ 3.1~a1+20090322

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from importlib import abc
 
2
from importlib import machinery
 
3
import unittest
 
4
 
 
5
 
 
6
class SubclassTests(unittest.TestCase):
 
7
 
 
8
    """Test that the various classes in importlib are subclasses of the
 
9
    expected ABCS."""
 
10
 
 
11
    def verify(self, ABC, *classes):
 
12
        """Verify the classes are subclasses of the ABC."""
 
13
        for cls in classes:
 
14
            self.assert_(issubclass(cls, ABC))
 
15
 
 
16
    def test_Finder(self):
 
17
        self.verify(abc.Finder, machinery.BuiltinImporter,
 
18
                    machinery.FrozenImporter, machinery.PathFinder)
 
19
 
 
20
    def test_Loader(self):
 
21
        self.verify(abc.Loader, machinery.BuiltinImporter,
 
22
                    machinery.FrozenImporter)
 
23
 
 
24
 
 
25
def test_main():
 
26
    from test.support import run_unittest
 
27
    run_unittest(SubclassTests)
 
28
 
 
29
 
 
30
if __name__ == '__main__':
 
31
    test_main()