2009-01-27 01:34:30 +00:00
|
|
|
import abc
|
2009-01-18 00:24:28 +00:00
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
2009-01-27 01:34:30 +00:00
|
|
|
class FinderTests(unittest.TestCase, metaclass=abc.ABCMeta):
|
2009-01-18 00:24:28 +00:00
|
|
|
|
|
|
|
"""Basic tests for a finder to pass."""
|
|
|
|
|
2009-01-27 01:34:30 +00:00
|
|
|
@abc.abstractmethod
|
2009-01-18 00:24:28 +00:00
|
|
|
def test_module(self):
|
|
|
|
# Test importing a top-level module.
|
2009-01-27 01:34:30 +00:00
|
|
|
pass
|
2009-01-18 00:24:28 +00:00
|
|
|
|
2009-01-27 01:34:30 +00:00
|
|
|
@abc.abstractmethod
|
2009-01-18 00:24:28 +00:00
|
|
|
def test_package(self):
|
|
|
|
# Test importing a package.
|
2009-01-27 01:34:30 +00:00
|
|
|
pass
|
2009-01-18 00:24:28 +00:00
|
|
|
|
2009-01-27 01:34:30 +00:00
|
|
|
@abc.abstractmethod
|
2009-01-18 00:24:28 +00:00
|
|
|
def test_module_in_package(self):
|
|
|
|
# Test importing a module contained within a package.
|
|
|
|
# A value for 'path' should be used if for a meta_path finder.
|
2009-01-27 01:34:30 +00:00
|
|
|
pass
|
2009-01-18 00:24:28 +00:00
|
|
|
|
2009-01-27 01:34:30 +00:00
|
|
|
@abc.abstractmethod
|
2009-01-18 00:24:28 +00:00
|
|
|
def test_package_in_package(self):
|
|
|
|
# Test importing a subpackage.
|
|
|
|
# A value for 'path' should be used if for a meta_path finder.
|
2009-01-27 01:34:30 +00:00
|
|
|
pass
|
2009-01-18 00:24:28 +00:00
|
|
|
|
2009-01-27 01:34:30 +00:00
|
|
|
@abc.abstractmethod
|
2009-01-18 00:24:28 +00:00
|
|
|
def test_package_over_module(self):
|
|
|
|
# Test that packages are chosen over modules.
|
2009-01-27 01:34:30 +00:00
|
|
|
pass
|
2009-01-18 00:24:28 +00:00
|
|
|
|
2009-01-27 01:34:30 +00:00
|
|
|
@abc.abstractmethod
|
2009-01-18 00:24:28 +00:00
|
|
|
def test_failure(self):
|
|
|
|
# Test trying to find a module that cannot be handled.
|
2009-01-27 01:34:30 +00:00
|
|
|
pass
|