Message338934
My base idea would be some unittests for the function like:
class ExtendPathBaseTests(unittest.TestCase):
def test_input_string(self):
path = 'path'
name = 'foo'
self.assertEqual('path', pkgutil.extend_path(path, name))
def test_parent_package_raise_key_error(self):
path = ['path']
# sys.modules['foo'] raise KeyError
name = 'foo.bar'
self.assertEqual(['path'], pkgutil.extend_path(path, name))
def test_parent_package_raise_attr_error(self):
path = ['path']
# datetime module don't have __path__ attr
name = 'datetime.date'
self.assertEqual(['path'], pkgutil.extend_path(path, name))
I would move forward if we agreed. |
|
Date |
User |
Action |
Args |
2019-03-27 01:55:31 | Windson Yang | set | recipients:
+ Windson Yang, pitrou, eric.smith, Arfrever |
2019-03-27 01:55:31 | Windson Yang | set | messageid: <1553651731.06.0.485854699573.issue14817@roundup.psfhosted.org> |
2019-03-27 01:55:31 | Windson Yang | link | issue14817 messages |
2019-03-27 01:55:30 | Windson Yang | create | |
|