selftest problem: No module named launchpad
Martin Pool
mbp at sourcefrog.net
Thu Apr 26 05:49:38 BST 2007
On 4/26/07, Robert Collins <robertc at robertcollins.net> wrote:
> +
> self.assertFalse(sys.modules.has_key('bzrlib.plugins.get_topics'))
> + demo_module = FakeModule('', 'bzrlib.plugins.get_topics')
> + sys.modules['bzrlib.plugins.get_topics'] = demo_module
> + try:
> + topics = index.get_topics('get_topics')
> + self.assertEqual(1, len(topics))
> + self.assertIsInstance(topics[0], plugin.ModuleHelpTopic)
> + self.assertEqual(demo_module, topics[0].module)
> + finally:
> + del sys.modules['bzrlib.plugins.get_topics']
That looks ok, except that the reuse of the name 'get_topics' here is
strange. Why not call it 'fake_module' or something?
--
Martin
More information about the bazaar
mailing list