def test_set_device_mtu(self, execute): linux_net._set_device_mtu(dev='fakedev', mtu=1500) expected = ['ip', 'link', 'set', 'fakedev', 'mtu', 1500] execute.assert_called_with(*expected, check_exit_code=mock.ANY)
def test_set_device_mtu(self, execute): linux_net._set_device_mtu(dev='fakedev', mtu=1500) expected = ['ip', 'link', 'set', 'fakedev', 'mtu', 1500] execute.assert_called_with(*expected, check_exit_code=mock.ANY)
def test_set_device_invalid_mtu(self, mock_exec): linux_net._set_device_mtu(dev='fakedev', mtu=None) mock_exec.assert_not_called()
def test_set_device_mtu(self, mock_ip_set): linux_net._set_device_mtu(dev='fakedev', mtu=1500) mock_ip_set.assert_called_once_with('fakedev', mtu=1500, check_exit_code=[0, 2, 254])