Skip to content

Commit cf0cd3b

Browse files
author
rtschu
committed
unified codingstyle
1 parent 1723719 commit cf0cd3b

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

generator.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ def get_scenario(mode, standardtime, students_state, idnumber_state, mapped_stat
158158
This constructs the actual scenario by building all courses, states etc.
159159
:return: string the combined enviroment specifiing string for a scenario
160160
"""
161-
behat_scenario = manual_auto_mode[mode].replace("{{category}}", str(category)) + "\n"
162-
behat_scenario += standardtimeMode[standardtime].replace("{{category}}", str(category)) + "\n"
163-
behat_scenario += studentsState[students_state] + "\n"
164-
behat_scenario += idnumberState(idnumber_state, actual_state)
165-
behat_scenario += mappedState(mapped_state, actual_state)
166-
behat_scenario += internalState[internal_state].replace("{{course}}", str(coursename)) + "\n"
161+
behat_scenario = step_manual_auto_mode[mode].replace("{{category}}", str(category)) + "\n"
162+
behat_scenario += step_standardtime_mode[standardtime].replace("{{category}}", str(category)) + "\n"
163+
behat_scenario += step_students_state[students_state] + "\n"
164+
behat_scenario += step_idnumberstate(idnumber_state, actual_state)
165+
behat_scenario += step_mappedstate(mapped_state, actual_state)
166+
behat_scenario += step_internal_state[internal_state].replace("{{course}}", str(coursename)) + "\n"
167167
behat_scenario += "And I turn editing mode on\n"
168168
behat_scenario += "And I add the \"EvaSys Sync\" block\n"
169169
behat_scenario += "And I turn editing mode off\n"

tests/behat/generator/steps.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,25 @@
4545

4646
# Environment configuration
4747

48-
manual_auto_mode = {
48+
step_manual_auto_mode = {
4949
"manual": "Given category {{category}} is in manual mode",
5050
"auto": "Given category {{category}} is in auto mode"
5151
}
5252

53-
standardtimeMode = {
53+
step_standardtime_mode = {
5454
0: "And category {{category}} is not in standardtime mode",
5555
1: "And category {{category}} is in standardtime mode with dates 1581043586 1582043586"
5656
}
5757

58-
internalState = {
58+
step_internal_state = {
5959
"notopened": "And the internal state of course {{course}} is \"notopened\"",
6060
"opened": "And the internal state of course {{course}} is \"opened\"",
6161
"closed": "And the internal state of course {{course}} is \"closed\"",
6262
"manual": "And the internal state of course {{course}} is \"manual\"",
6363
"none": "And there is no internal record of course {{course}}"
6464
}
6565

66-
studentsState = {
66+
step_students_state = {
6767
"none": "And no students enrolled in course " + coursename,
6868
"onlytutors": "And only tutors enrolled in course " + coursename,
6969
"multi": "And students enrolled in course " + coursename
@@ -123,7 +123,7 @@
123123
# or something has to be added programatically (like coursenames or ids)
124124

125125

126-
def idnumberState(state, openstate):
126+
def step_idnumberstate(state, openstate):
127127
"""
128128
:param state: idnumber state (none/invalid/one)
129129
:return: String either creating none, an invalid or one evasys-course - moodle-course link via idnumber
@@ -137,7 +137,7 @@ def idnumberState(state, openstate):
137137
return x
138138

139139

140-
def mappedState(state, openstate):
140+
def step_mappedstate(state, openstate):
141141
"""
142142
:param state: mapped state (none/invalid/one/multi)
143143
:return: a string creating none, only invalid, one or multiple mappings of a moodle-course to evasys-courses

0 commit comments

Comments
 (0)