def test_is_changes_needed_for_interface_no_l2(eth0, module, change_attr): module.params['name'] = 'eth0' eth0["address"] = None eth0["broadcast"] = None module.params[change_attr] = 'need_change' link = ip_link_device_attribute.Link(module) with pytest.raises(FailJsonException): link._is_changes_needed_for_interface(eth0)
def elink(module): ''' Link object with trivial initialization''' module.params["name"] = True link = ip_link_device_attribute.Link(module) return link
def test_is_changes_needed_for_nomaster_false(eth0, module): module.params['name'] = 'eth0' module.params['nomaster'] = False eth0["master"] = 'test' link = ip_link_device_attribute.Link(module) assert link._is_changes_needed_for_interface(eth0) is False
def test_is_changes_needed_for_interface_one_param(eth0, module, change_attr): module.params['name'] = 'eth0' module.params[change_attr] = 'need_change' link = ip_link_device_attribute.Link(module) assert link._is_changes_needed_for_interface(eth0) is True
def test_is_changes_needed_for_interface_no_changes(eth0, module): module.params['name'] = 'eth0' link = ip_link_device_attribute.Link(module) assert link._is_changes_needed_for_interface(eth0) is False