Path: blob/main/tests/netedit/elements/additionals/e3detector/inspect/id/test.py
169780 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 additional mode28netedit.changeMode("additional")2930# select E331netedit.changeElement("additionalFrame", "entryExitDetector")3233# create E3 with default parameters34netedit.leftClick(referencePosition, netedit.positions.elements.additionals.squaredA)3536# create E3 with default parameters37netedit.leftClick(referencePosition, netedit.positions.elements.additionals.squaredB)3839# select entry detector40netedit.changeElement("additionalFrame", "detExit")4142# Create entry detector with default value43netedit.leftClick(referencePosition, netedit.positions.elements.additionals.squaredA)44netedit.leftClick(referencePosition, netedit.positions.elements.edge0)4546# Create entry detector with default value47netedit.leftClick(referencePosition, netedit.positions.elements.additionals.squaredB)48netedit.leftClick(referencePosition, netedit.positions.elements.edge1)4950# select exit detector51netedit.changeElement("additionalFrame", "detEntry")5253# Create exit detector with default value54netedit.leftClick(referencePosition, netedit.positions.elements.additionals.squaredA)55netedit.leftClick(referencePosition, netedit.positions.elements.edge2)5657# Create exit detector with default value58netedit.leftClick(referencePosition, netedit.positions.elements.additionals.squaredB)59netedit.leftClick(referencePosition, netedit.positions.elements.edge3)6061# go to inspect mode62netedit.changeMode("inspect")6364# inspect first E365netedit.leftClick(referencePosition, netedit.positions.elements.additionals.squaredA)6667# Change parameter id with a non valid value (Duplicated ID)68netedit.modifyAttribute(netedit.attrs.E3.inspect.id, "e3_1")6970# Change parameter id with a non valid value (invalid characters)71netedit.modifyAttribute(netedit.attrs.E3.inspect.id, ";;;;;;;;;;;;;;;;;")7273# Change parameter id with a valid value (with spaces)74netedit.modifyAttribute(netedit.attrs.E3.inspect.id, "Id with spaces")7576# Change parameter id with a valid value77netedit.modifyAttribute(netedit.attrs.E3.inspect.id, "correctID")7879# Check undos and redos80netedit.checkUndoRedo(referencePosition)8182# save netedit config83netedit.saveExistentFile("neteditConfig")8485# quit netedit86netedit.quit(neteditProcess)878889