Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/importer_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pkgutil
import os
import sys
import threading
import types
Expand All @@ -9,6 +11,7 @@
except ImportError:
import mock

import mitogen
import mitogen.core
import mitogen.utils
from mitogen.core import b
Expand Down Expand Up @@ -46,6 +49,15 @@ def tearDown(self):
super(ImporterMixin, self).tearDown()


class MitogenPkgContentTest(testlib.TestCase):
def test_matches_filesystem(self):
mitogen_pkg_dir = os.path.dirname(mitogen.__file__)
self.assertEqual(
mitogen.core.Importer.MITOGEN_PKG_CONTENT,
sorted(mod.name for mod in pkgutil.iter_modules([mitogen_pkg_dir])),
)


class InvalidNameTest(ImporterMixin, testlib.TestCase):
modname = 'trailingdot.'
# 0:fullname 1:pkg_present 2:path 3:compressed 4:related
Expand Down
Loading