Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/tests/netedit/elements/additionals/access/trainstop/inspect/lane/test.py
169780 views
1
#!/usr/bin/env python
2
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
# Copyright (C) 2009-2025 German Aerospace Center (DLR) and others.
4
# This program and the accompanying materials are made available under the
5
# terms of the Eclipse Public License 2.0 which is available at
6
# https://www.eclipse.org/legal/epl-2.0/
7
# This Source Code may also be made available under the following Secondary
8
# Licenses when the conditions for such availability set forth in the Eclipse
9
# Public License 2.0 are satisfied: GNU General Public License, version 2
10
# or later which is available at
11
# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
14
# @file test.py
15
# @author Pablo Alvarez Lopez
16
# @date 2016-11-25
17
18
# import common functions for netedit tests
19
import os
20
import sys
21
22
sys.path.append(os.path.join(os.environ.get("SUMO_HOME", "."), "tools"))
23
import neteditTestFunctions as netedit # noqa
24
25
# Open netedit
26
neteditProcess, referencePosition = netedit.setupAndStart()
27
28
# go to additional mode
29
netedit.changeMode("additional")
30
31
# select TrainStop
32
netedit.changeElement("additionalFrame", "trainStop")
33
34
# create TrainStop with default parameters
35
netedit.leftClick(referencePosition, netedit.positions.elements.edgeCenter1)
36
37
# select Access
38
netedit.changeElement("additionalFrame", "access")
39
40
# Create two Access
41
netedit.selectAdditionalChild(netedit.attrs.access.create.parent, 0)
42
netedit.leftClick(referencePosition, netedit.positions.elements.edge1Ped)
43
netedit.leftClick(referencePosition, netedit.positions.elements.edge2Ped)
44
45
# go to inspect mode
46
netedit.changeMode("inspect")
47
48
# inspect Access
49
netedit.leftClick(referencePosition, netedit.positions.elements.edge1Ped)
50
51
# Change parameter lane with a non valid value (dummy Lane)
52
netedit.modifyAttributeOverlapped(netedit.attrs.access.inspect.lane, "dummyLane")
53
54
# Change parameter lane with a non valid value (Empty lane)
55
netedit.modifyAttributeOverlapped(netedit.attrs.access.inspect.lane, "")
56
57
# Change parameter lane with a non valid value (There is another Access in the same edge)
58
netedit.modifyAttributeOverlapped(netedit.attrs.access.inspect.lane, "E1_0")
59
60
# Change parameter lane with a valid value (other lane)
61
netedit.modifyAttributeOverlapped(netedit.attrs.access.inspect.lane, "E4_0")
62
63
# Check undo redo
64
netedit.checkUndoRedo(referencePosition)
65
66
# save netedit config
67
netedit.saveExistentFile("neteditConfig")
68
69
# set friendlyPos
70
netedit.typeKey("space")
71
72
# quit netedit
73
netedit.quit(neteditProcess)
74
75