def test_delete_non_existing_route(self, execute_command): execute_command.return_value = self.ip_route_list_output route = Route('1.2.3.4', 'wlo1') route.gateway = '192.168.0.254' with self.assertRaises(ObjectNotFoundException): route.delete() execute_command.assert_called_with('ip route del 1.2.3.4', namespace=None)
def step_impl(context, destination, device): route = Route(destination, device) if route.exists(): route.delete()
def test_delete_existing_route(self, execute_command): execute_command.return_value = self.ip_route_list_output route = Route('default', 'wlo1') route.gateway = '192.168.0.254' route.delete() execute_command.assert_called_with('ip route del default', namespace=None)