From c81f366fc613c5f99f1c2bec088906393bc7f218 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sat, 17 Aug 2019 22:02:32 +0100 Subject: [PATCH] issue #590: whoops, import missing test modules --- .../pkg_like_ansible/module_utils/sys_distro/__init__.py | 5 +++++ .../pkg_like_ansible/module_utils/sys_distro/_distro.py | 1 + tests/data/importer/system_distro.py | 2 ++ tests/responder_test.py | 1 - 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 tests/data/importer/pkg_like_ansible/module_utils/sys_distro/__init__.py create mode 100644 tests/data/importer/pkg_like_ansible/module_utils/sys_distro/_distro.py create mode 100644 tests/data/importer/system_distro.py diff --git a/tests/data/importer/pkg_like_ansible/module_utils/sys_distro/__init__.py b/tests/data/importer/pkg_like_ansible/module_utils/sys_distro/__init__.py new file mode 100644 index 00000000..f757e54c --- /dev/null +++ b/tests/data/importer/pkg_like_ansible/module_utils/sys_distro/__init__.py @@ -0,0 +1,5 @@ +# #590: a subpackage that turns itself into a module from elsewhere on sys.path. +I_AM = "the subpackage that was replaced with a system module" +import sys +import system_distro +sys.modules[__name__] = system_distro diff --git a/tests/data/importer/pkg_like_ansible/module_utils/sys_distro/_distro.py b/tests/data/importer/pkg_like_ansible/module_utils/sys_distro/_distro.py new file mode 100644 index 00000000..16c32b2a --- /dev/null +++ b/tests/data/importer/pkg_like_ansible/module_utils/sys_distro/_distro.py @@ -0,0 +1 @@ +I_AM = "the module inside the replaced subpackage" diff --git a/tests/data/importer/system_distro.py b/tests/data/importer/system_distro.py new file mode 100644 index 00000000..78fb1601 --- /dev/null +++ b/tests/data/importer/system_distro.py @@ -0,0 +1,2 @@ +# #590: a system module that replaces some subpackage +I_AM = "the system module that replaced the subpackage" diff --git a/tests/responder_test.py b/tests/responder_test.py index 60817747..2653589c 100644 --- a/tests/responder_test.py +++ b/tests/responder_test.py @@ -159,7 +159,6 @@ class BrokenModulesTest(testlib.TestCase): self.assertEquals(1, responder.get_module_count) self.assertEquals(1, responder.good_load_module_count) - self.assertEquals(7642, responder.good_load_module_size) self.assertEquals(0, responder.bad_load_module_count) call = router._async_route.mock_calls[0]