plugin_Example_event was wrongly turned into PLUGIN__EXAMPLE_EVENT. Fixed regex to solve this. Closes #4417
23 lines
723 B
Python
23 lines
723 B
Python
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
|
|
__copyright__ = "Copyright (C) 2022 The OctoPrint Project - Released under terms of the AGPLv3 License"
|
|
|
|
import unittest
|
|
|
|
import ddt
|
|
|
|
import octoprint.events
|
|
|
|
|
|
@ddt.ddt
|
|
class TestEvents(unittest.TestCase):
|
|
@ddt.data(
|
|
("plugin_example_event", "PLUGIN_EXAMPLE_EVENT"),
|
|
("plugin_Example_event", "PLUGIN_EXAMPLE_EVENT"),
|
|
("plugin_ExAmple_Event", "PLUGIN_EX_AMPLE_EVENT"),
|
|
("plugin_exAmple_EvEnt", "PLUGIN_EX_AMPLE_EV_ENT"),
|
|
)
|
|
@ddt.unpack
|
|
def test_to_identifier(self, value, expected):
|
|
actual = octoprint.events.Events._to_identifier(value)
|
|
self.assertEqual(actual, expected)
|