Skip to content

Commit 8029b63

Browse files
committed
test(opennebula): remove test_get_field_nonecontext
Context values come exclusively from parse_shell_config which returns Dict[str, str]. Shell variables can only be absent or hold string values, so a None context value is impossible in production. The equivalent realistic scenario is already covered by test_get_field_emptycontext. Refs GH-6810
1 parent 308c58c commit 8029b63

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

tests/unittests/sources/test_opennebula.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -572,17 +572,6 @@ def test_get_field_emptycontext(self):
572572
val = net.get_field("eth9", "dummy")
573573
assert None is val
574574

575-
def test_get_field_nonecontext(self):
576-
"""
577-
Verify get_field('device', 'name') returns None if context value is
578-
None.
579-
"""
580-
# Deliberately passing None value to test defensive handling in get_field
581-
context = {"ETH9_DUMMY": None}
582-
net = ds.OpenNebulaNetwork(context, mock.Mock()) # type: ignore[arg-type]
583-
val = net.get_field("eth9", "dummy")
584-
assert None is val
585-
586575
@mock.patch(DS_PATH + ".get_physical_nics_by_mac")
587576
def test_gen_conf_gateway(self, m_get_phys_by_mac):
588577
"""Test rendering with/without IPv4 gateway"""

0 commit comments

Comments
 (0)