From 827940fb2c36c0d9c2d5e637a34fc90519a0e384 Mon Sep 17 00:00:00 2001 From: Milan Fencik Date: Mon, 25 Nov 2024 18:00:26 +0000 Subject: [PATCH] fix tests --- .../neutron_understack/config.py | 5 ++++- .../tests/test_neutron_understack_mech.py | 14 ++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/python/neutron-understack/neutron_understack/config.py b/python/neutron-understack/neutron_understack/config.py index fa2479f69..f48264c9f 100644 --- a/python/neutron-understack/neutron_understack/config.py +++ b/python/neutron-understack/neutron_understack/config.py @@ -27,7 +27,10 @@ ), cfg.StrOpt( "undersync_token", - help="Undersync API token. If not provided, the '/etc/undersync/token' will be read instead.", + help=( + "Undersync API token. If not provided, " + "the '/etc/undersync/token' will be read instead." + ), ), cfg.BoolOpt( "undersync_dry_run", default=True, help="Call Undersync with dry-run mode" diff --git a/python/neutron-understack/neutron_understack/tests/test_neutron_understack_mech.py b/python/neutron-understack/neutron_understack/tests/test_neutron_understack_mech.py index a49aa5b6c..37eacbd9b 100644 --- a/python/neutron-understack/neutron_understack/tests/test_neutron_understack_mech.py +++ b/python/neutron-understack/neutron_understack/tests/test_neutron_understack_mech.py @@ -40,8 +40,8 @@ def test_fetch_connected_interface_uuid(context): def test_fail_fetch_connected_interface_uuid(context): context.current["binding:profile"]["local_link_information"][0]["port_id"] = 11 - result = driver.fetch_connected_interface_uuid(context) - assert result is None + with pytest.raises(ValueError): + driver.fetch_connected_interface_uuid(context) def test_update_nautobot_for_tenant_network(nautobot_client): @@ -91,13 +91,3 @@ def test_wrong_vif_type_update_port_post_commit( driver.update_port_postcommit(context) mocked_fetch_connected_interface_uuid.assert_not_called() - - -@patch("neutron_understack.neutron_understack_mech.UnderstackDriver.update_nautobot") -def test_no_conn_interface_uuid_update_port_post_commit( - mocked_update_nautobot, context -): - context.current["binding:profile"]["local_link_information"][0]["port_id"] = 11 - driver.update_port_postcommit(context) - - mocked_update_nautobot.assert_not_called()