-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
test.py
executable file
·54 lines (42 loc) · 1.77 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env python
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
# Copyright (C) 2009-2023 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0/
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the Eclipse
# Public License 2.0 are satisfied: GNU General Public License, version 2
# or later which is available at
# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
# @file test.py
# @author Pablo Alvarez Lopez
# @date 2019-07-16
# import common functions for netedit tests
import os
import sys
testRoot = os.path.join(os.environ.get('SUMO_HOME', '.'), 'tests')
neteditTestRoot = os.path.join(
os.environ.get('TEXTTEST_HOME', testRoot), 'netedit')
sys.path.append(neteditTestRoot)
import neteditTestFunctions as netedit # noqa
# Open netedit
neteditProcess, referencePosition = netedit.setupAndStart(neteditTestRoot)
# go to demand mode
netedit.supermodeDemand()
# go to stop mode
netedit.stopMode()
# change stop type with a valid value
netedit.changeStopType("stopParkingArea")
# set invalid value
netedit.changeDefaultBoolValue(netedit.attrs.stopParkingArea.create.onDemand)
# try to create stop
netedit.leftClick(referencePosition, netedit.positions.demandElements.parkingArea.x,
netedit.positions.demandElements.parkingArea.y)
# Check undo redo
netedit.checkUndoRedo(referencePosition)
# save Netedit config
netedit.saveNeteditConfig(referencePosition)
# quit netedit
netedit.quit(neteditProcess)