Skip to content

Commit

Permalink
update the listener serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
ephraimbuddy committed Oct 19, 2023
1 parent f8b11d9 commit e1ca400
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/api_connexion/endpoints/test_plugin_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# under the License.
from __future__ import annotations

import inspect

import pytest
from flask import Blueprint
from flask_appbuilder import BaseView
Expand Down Expand Up @@ -82,6 +84,10 @@ def next_dagrun_info(
pass


class MyCustomListener:
pass


class MockPlugin(AirflowPlugin):
name = "mock_plugin"
flask_blueprints = [bp]
Expand All @@ -93,7 +99,7 @@ class MockPlugin(AirflowPlugin):
macros = [plugin_macro]
ti_deps = [ti_dep]
timetables = [CustomTimetable]
listeners = [pytest] # using pytest here because we need a module(just for test)
listeners = [pytest, MyCustomListener()] # using pytest here because we need a module(just for test)


@pytest.fixture(scope="module")
Expand Down Expand Up @@ -147,7 +153,10 @@ def test_get_plugins_return_200(self):
"name": "test_plugin",
"timetables": [qualname(CustomTimetable)],
"ti_deps": [str(ti_dep)],
"listeners": [pytest.__name__],
"listeners": [
d.__name__ if inspect.ismodule(d) else qualname(d)
for d in [pytest, MyCustomListener()]
],
}
],
"total_entries": 1,
Expand Down

0 comments on commit e1ca400

Please sign in to comment.