Exemplo n.º 1
0
def patch_get_entry_info_for_gui_scripts():
    import pkg_resources

    def get_entry_info(self, group, name):
        return self.get_entry_map("gui_scripts" if group == "console_scripts" else group).get(name)

    with patch(pkg_resources.Distribution, "get_entry_info", get_entry_info):
        yield
Exemplo n.º 2
0
def patch_get_entry_map_for_gui_scripts():
    import pkg_resources
    _get_entry_map = pkg_resources.get_entry_map

    def get_entry_map(dist, group=None):
        return _get_entry_map(dist, "gui_scripts")

    with patch(pkg_resources, "get_entry_map", get_entry_map):
        yield
Exemplo n.º 3
0
 def test__patch_context(self):
     with patch(os, "listdir", listdir_patch):
         result = os.listdir(TEST_PATH)
         self.assertEqual(result, [TEST_PATH])
     self.assertNotEqual(os.listdir('.'), [TEST_PATH])