Path: blob/main/tests/netedit/selection/basic/wrong_parameters/test.py
169708 views
#!/usr/bin/env python1# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2# Copyright (C) 2009-2025 German Aerospace Center (DLR) and others.3# This program and the accompanying materials are made available under the4# terms of the Eclipse Public License 2.0 which is available at5# https://www.eclipse.org/legal/epl-2.0/6# This Source Code may also be made available under the following Secondary7# Licenses when the conditions for such availability set forth in the Eclipse8# Public License 2.0 are satisfied: GNU General Public License, version 29# or later which is available at10# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later1213# @file test.py14# @author Pablo Alvarez Lopez15# @date 2016-11-251617# import common functions for netedit tests18import os19import sys2021sys.path.append(os.path.join(os.environ.get("SUMO_HOME", "."), "tools"))22import neteditTestFunctions as netedit # noqa2324# Open netedit25neteditProcess, referencePosition = netedit.setupAndStart()2627# go to select mode28netedit.changeMode("select")2930# try to select node gneJ0 and delete it (Error in element set)31netedit.focusOnFrame()32for x in range(0, 8):33netedit.typeKey("tab")3435# paste the new elementClass36netedit.updateText("dummyElement")3738# set elementClass39netedit.typeKey("enter")4041# try to select node gneJ0 and delete it (Error in element type)42netedit.focusOnFrame()43for x in range(0, 8):44netedit.typeKey("tab")4546# paste the new elementClass47netedit.updateText("Network")4849# jump to element50for x in range(0, 3):51netedit.typeKey("tab")5253# paste the new elementType54netedit.updateText("dummyType")5556# type tab to set elementType57netedit.typeKey("enter")5859# try to select node gneJ0 and delete it (Error in set)60netedit.focusOnFrame()61for x in range(0, 8):62netedit.typeKey("tab")6364# paste the new elementClass65netedit.updateText("Network")6667# jump to element68for x in range(0, 3):69netedit.typeKey("tab")7071# paste the new elementType72netedit.updateText("junction")7374# jump to attribute75for x in range(0, 2):76netedit.typeKey("tab")7778# paste the new attribute79netedit.updateText("dummyAttribute")8081# type enter to set attribute82netedit.typeKey("enter")8384# try to select node gneJ0 and delete it (Error in type of element)85netedit.selectNetworkItems("junction", "id", "J0")86netedit.delete()8788# save Netedit config89netedit.saveExistentFile("neteditConfig")9091# quit netedit92netedit.quit(neteditProcess)939495