'A package can delete its __path__ for some reasons,
C{modules.PythonPath} should be able to deal with it.'

def test_packageMissingPath(self):

    mypath = FilePath(self.mktemp())
    mypath.createDirectory()
    pp = modules.PythonPath(sysPath=[mypath.path])
    subpath = mypath.child('abcd')
    subpath.createDirectory()
    subpath.child('__init__.py').setContent('del    __path__\n')
    sys.path.append(mypath.path)
    __import__('abcd')
    try:
        l = list(pp.walkModules())
        self.assertEqual(len(l), 1)
        self.assertEqual(l[0].name, 'abcd')
    finally:
        del sys.modules['abcd']
        sys.path.remove(mypath.path)
