Add a test case for lazyimport._preload_portage_submodules().
authorZac Medico <zmedico@gentoo.org>
Thu, 5 Aug 2010 22:11:24 +0000 (15:11 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 5 Aug 2010 22:11:24 +0000 (15:11 -0700)
pym/portage/tests/lazyimport/__init__.py [new file with mode: 0644]
pym/portage/tests/lazyimport/__test__ [new file with mode: 0644]
pym/portage/tests/lazyimport/test_preload_portage_submodules.py [new file with mode: 0644]

diff --git a/pym/portage/tests/lazyimport/__init__.py b/pym/portage/tests/lazyimport/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/pym/portage/tests/lazyimport/__test__ b/pym/portage/tests/lazyimport/__test__
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/pym/portage/tests/lazyimport/test_preload_portage_submodules.py b/pym/portage/tests/lazyimport/test_preload_portage_submodules.py
new file mode 100644 (file)
index 0000000..9d20eba
--- /dev/null
@@ -0,0 +1,16 @@
+# Copyright 2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import portage
+from portage.tests import TestCase
+
+class PreloadPortageSubmodulesTestCase(TestCase):
+
+       def testPreloadPortageSubmodules(self):
+               """
+               Verify that _preload_portage_submodules() doesn't leave any
+               remaining proxies that refer to the portage.* namespace.
+               """
+               portage.proxy.lazyimport._preload_portage_submodules()
+               for name in portage.proxy.lazyimport._module_proxies:
+                       self.assertEqual(name.startswith('portage.'), False)