Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: allow users to import id constants from api #508

Merged
merged 11 commits into from
Mar 10, 2023
23 changes: 22 additions & 1 deletion envisage/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,19 @@
- :class:`~.IPluginManager`
- :class:`~.IServiceRegistry`

Constants
---------
- :data:`~.BINDINGS`
- :data:`~.COMMANDS`
- :data:`~.PREFERENCES`
- :data:`~.PREFERENCES_CATEGORIES`
- :data:`~.PREFERENCES_PANES`
- :data:`~.SERVICE_OFFERS`
- :data:`~.TASKS`
- :data:`~.TASK_EXTENSIONS`

Application, plugin and related classes
------------------------------------------
---------------------------------------
- :class:`~.Application`
- :class:`~.CorePlugin`
- :class:`~.EggPluginManager`
Expand Down Expand Up @@ -76,6 +87,16 @@
)
from .extension_provider import ExtensionProvider
from .extension_point_changed_event import ExtensionPointChangedEvent
from .ids import (
BINDINGS,
COMMANDS,
PREFERENCES,
PREFERENCES_CATEGORIES,
PREFERENCES_PANES,
SERVICE_OFFERS,
TASKS,
TASK_EXTENSIONS
)
from .import_manager import ImportManager
from .plugin import Plugin
from .plugin_activator import PluginActivator
Expand Down
28 changes: 28 additions & 0 deletions envisage/tests/test_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# (C) Copyright 2007-2023 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at http://www.enthought.com/licenses/BSD.txt
#
# Thanks for using Enthought open source!

import unittest
mdickinson marked this conversation as resolved.
Show resolved Hide resolved

import envisage.api as api
import envisage.ids as ids


class TestApi(unittest.TestCase):
""" Test for API """
def test_import(self):
self.assertEqual(api.BINDINGS, ids.BINDINGS)
self.assertEqual(api.COMMANDS, ids.COMMANDS)
self.assertEqual(api.PREFERENCES, ids.PREFERENCES)
self.assertEqual(api.PREFERENCES_CATEGORIES,
ids.PREFERENCES_CATEGORIES)
self.assertEqual(api.PREFERENCES_PANES, ids.PREFERENCES_PANES)
self.assertEqual(api.SERVICE_OFFERS, ids.SERVICE_OFFERS)
self.assertEqual(api.TASKS, ids.TASKS)
self.assertEqual(api.TASK_EXTENSIONS, ids.TASK_EXTENSIONS)