Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions tests/providers/yandex/secrets/test_lockbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import yandex.cloud.lockbox.v1.secret_pb2 as secret_pb
import yandex.cloud.lockbox.v1.secret_service_pb2 as secret_service_pb

from airflow.exceptions import RemovedInAirflow3Warning
from airflow.providers.yandex.secrets.lockbox import LockboxSecretBackend
from airflow.providers.yandex.utils.defaults import default_conn_name

Expand Down Expand Up @@ -60,26 +59,17 @@ def test_yandex_lockbox_secret_backend_get_connection(self, mock_get_value):
def test_yandex_lockbox_secret_backend_get_connection_from_json(self, mock_get_value):
conn_id = "airflow_to_yandexcloud"
conn_type = "yandex_cloud"
extra = "some extra values"
extra = '{"some": "extra values"}'
c = {
"conn_type": conn_type,
"extra": extra,
}

mock_get_value.return_value = json.dumps(c)

match = "Encountered non-JSON in `extra` field for connection 'airflow_to_yandexcloud'. Support for non-JSON `extra` will be removed in Airflow 3.0"
with pytest.warns(
RemovedInAirflow3Warning,
match=match,
):
conn = LockboxSecretBackend().get_connection(conn_id)

with pytest.warns(
RemovedInAirflow3Warning,
match=match,
):
assert conn.extra == extra
conn = LockboxSecretBackend().get_connection(conn_id)

assert conn.extra == extra

assert conn.conn_id == conn_id
assert conn.conn_type == conn_type
Expand Down