Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jk_interface_test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huangqiang
jk_interface_test
Commits
982db369
Commit
982db369
authored
Jun 25, 2021
by
刘琴
Browse files
Options
Browse Files
Download
Plain Diff
'merge'
parents
6aa46523
99f36b93
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
523 additions
and
14 deletions
+523
-14
misc.xml
.idea/misc.xml
+5
-0
workspace.xml
.idea/workspace.xml
+42
-12
run.py
run.py
+2
-2
__init__.py
...i_yun_ying_pc/service_education_liuqin/Common/__init__.py
+0
-0
helpler.py
...ji_yun_ying_pc/service_education_liuqin/Common/helpler.py
+76
-0
__init__.py
script/ji_yun_ying_pc/service_education_liuqin/__init__.py
+0
-0
Course_Data.py
...pc/service_education_liuqin/courses_liuqin/Course_Data.py
+101
-0
__init__.py
...ng_pc/service_education_liuqin/courses_liuqin/__init__.py
+0
-0
test_case_course.py
...rvice_education_liuqin/courses_liuqin/test_case_course.py
+297
-0
No files found.
.idea/misc.xml
View file @
982db369
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<<<<<<
< HEAD
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.7 (jk_interface_test) (2)"
project-jdk-type=
"Python SDK"
/>
=======
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.7 (jk_interface_test) (3)"
project-jdk-type=
"Python SDK"
/>
>>>>>>> 99f36b935c809d3f930d37a6d8d797cb54a831c8
</project>
\ No newline at end of file
.idea/workspace.xml
View file @
982db369
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<<<<<<
< HEAD
<list
default=
"true"
id=
"ceb24b37-65a1-4b3f-be3f-7040ebc4079d"
name=
"默认变更列表"
comment=
"默认变更列表"
>
<change
beforePath=
"$PROJECT_DIR$/.idea/jk_interface_test.iml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/jk_interface_test.iml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/misc.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/misc.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
=======
<list
default=
"true"
id=
"ceb24b37-65a1-4b3f-be3f-7040ebc4079d"
name=
"默认变更列表"
comment=
""
>
<change
afterPath=
"$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/Common/__init__.py"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/Common/helpler.py"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/__init__.py"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin/Course_Data.py"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin/__init__.py"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin/test_case_course.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/jk_interface_test.iml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/jk_interface_test.iml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/misc.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/misc.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/run.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/run.py"
afterDir=
"false"
/>
>>>>>>> 99f36b935c809d3f930d37a6d8d797cb54a831c8
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
...
@@ -22,6 +36,11 @@
<option
name=
"BRANCH"
value=
"origin/liuqin_jyy"
/>
</component>
<component
name=
"Git.Settings"
>
<option
name=
"RECENT_BRANCH_BY_REPOSITORY"
>
<map>
<entry
key=
"$PROJECT_DIR$"
value=
"master"
/>
</map>
</option>
<option
name=
"RECENT_GIT_ROOT_PATH"
value=
"$PROJECT_DIR$"
/>
</component>
<component
name=
"GitSEFilterConfiguration"
>
...
...
@@ -45,10 +64,13 @@
<component
name=
"PropertiesComponent"
>
<property
name=
"RunOnceActivity.OpenProjectViewOnStart"
value=
"true"
/>
<property
name=
"RunOnceActivity.ShowReadmeOnStart"
value=
"true"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$"
/>
<property
name=
"settings.editor.selected.configurable"
value=
"
com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable
"
/>
<property
name=
"last_opened_file_path"
value=
"$PROJECT_DIR$
/script/ji_yun_ying_pc/service_education_liuqin/Common
"
/>
<property
name=
"settings.editor.selected.configurable"
value=
"
File.Encoding
"
/>
</component>
<component
name=
"RecentsManager"
>
<key
name=
"CopyFile.RECENT_KEYS"
>
<recent
name=
"D:\interface\jk_interface_test\script\ji_yun_ying_pc\service_education_liuqin\Common"
/>
</key>
<key
name=
"MoveFile.RECENT_KEYS"
>
<recent
name=
"$PROJECT_DIR$/script/ji_yun_ying_pc/mall/store_shopping_mall"
/>
<recent
name=
"$PROJECT_DIR$/tools"
/>
...
...
@@ -57,8 +79,8 @@
<recent
name=
"$PROJECT_DIR$/script/ding_ding_jdata/full_class_rate/assert_config"
/>
</key>
</component>
<component
name=
"RunManager"
selected=
"Python.run
_cmd
"
>
<configuration
name=
"
debug
"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<component
name=
"RunManager"
selected=
"Python.run"
>
<configuration
name=
"
Course_Data
"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"jk_interface_test"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
...
...
@@ -66,11 +88,11 @@
<env
name=
"PYTHONUNBUFFERED"
value=
"1"
/>
</envs>
<option
name=
"SDK_HOME"
value=
""
/>
<option
name=
"WORKING_DIRECTORY"
value=
"$PROJECT_DIR$/
test
"
/>
<option
name=
"WORKING_DIRECTORY"
value=
"$PROJECT_DIR$/
script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin
"
/>
<option
name=
"IS_MODULE_SDK"
value=
"true"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
test/debug
.py"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin/Course_Data
.py"
/>
<option
name=
"PARAMETERS"
value=
""
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
...
...
@@ -79,7 +101,7 @@
<option
name=
"INPUT_FILE"
value=
""
/>
<method
v=
"2"
/>
</configuration>
<configuration
name=
"
init_base_api
"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<configuration
name=
"
helpler
"
type=
"PythonConfigurationType"
factoryName=
"Python"
temporary=
"true"
nameIsGenerated=
"true"
>
<module
name=
"jk_interface_test"
/>
<option
name=
"INTERPRETER_OPTIONS"
value=
""
/>
<option
name=
"PARENT_ENVS"
value=
"true"
/>
...
...
@@ -87,11 +109,11 @@
<env
name=
"PYTHONUNBUFFERED"
value=
"1"
/>
</envs>
<option
name=
"SDK_HOME"
value=
""
/>
<option
name=
"WORKING_DIRECTORY"
value=
"$PROJECT_DIR$/
tools
"
/>
<option
name=
"WORKING_DIRECTORY"
value=
"$PROJECT_DIR$/
script/ji_yun_ying_pc/service_education_liuqin/Common
"
/>
<option
name=
"IS_MODULE_SDK"
value=
"true"
/>
<option
name=
"ADD_CONTENT_ROOTS"
value=
"true"
/>
<option
name=
"ADD_SOURCE_ROOTS"
value=
"true"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
tools/init_base_api
.py"
/>
<option
name=
"SCRIPT_NAME"
value=
"$PROJECT_DIR$/
script/ji_yun_ying_pc/service_education_liuqin/Common/helpler
.py"
/>
<option
name=
"PARAMETERS"
value=
""
/>
<option
name=
"SHOW_COMMAND_LINE"
value=
"false"
/>
<option
name=
"EMULATE_TERMINAL"
value=
"false"
/>
...
...
@@ -164,19 +186,27 @@
<method
v=
"2"
/>
</configuration>
<list>
<<<<<<
< HEAD
<item
itemvalue=
"Python.debug"
/>
<item
itemvalue=
"Python.init_base_api"
/>
<item
itemvalue=
"Python.run"
/>
<item
itemvalue=
"Python.run_cmd"
/>
<item
itemvalue=
"Python.url_to_method"
/>
=======
<item
itemvalue=
"Python.url_to_method"
/>
<item
itemvalue=
"Python.run"
/>
<item
itemvalue=
"Python.run_cmd"
/>
<item
itemvalue=
"Python.Course_Data"
/>
<item
itemvalue=
"Python.helpler"
/>
>>>>>>> 99f36b935c809d3f930d37a6d8d797cb54a831c8
</list>
<recent_temporary>
<list>
<item
itemvalue=
"Python.run_cmd"
/>
<item
itemvalue=
"Python.run"
/>
<item
itemvalue=
"Python.Course_Data"
/>
<item
itemvalue=
"Python.helpler"
/>
<item
itemvalue=
"Python.run_cmd"
/>
<item
itemvalue=
"Python.url_to_method"
/>
<item
itemvalue=
"Python.debug"
/>
<item
itemvalue=
"Python.init_base_api"
/>
</list>
</recent_temporary>
</component>
...
...
run.py
View file @
982db369
...
...
@@ -62,14 +62,14 @@ class RunTest:
if
__name__
==
'__main__'
:
case_path_list
=
[
"./script/ji_yun_ying_pc/s
ystem_set/test_basic_parameter_set.py::TestFullClassTargetSet
"
,
"./script/ji_yun_ying_pc/s
ervice_education_liuqin/courses_liuqin/test_case_course.py::TestCourse::test_create_course_with_all_condition_success
"
,
# "./script/ding_ding_jdata/person_time/test_person_time.py::TestsPersonTimeDetail::test_detail_page_search_date",
# "./script/ding_ding_jdata/person_time/test_person_time.py::TestsPersonTimeDetail::test_detail_page_search_target",
# "./script/ding_ding_jdata/person_time/test_person_time.py::TestsPersonTimeDetail::test_detail_page_search_subject",
]
# host = "https://geek.jkwljy.com"
# account_group = "线上"
host
=
"http://1
92.168.32.36
"
host
=
"http://1
72.10.62.93/
"
account_group
=
"A"
db_config
=
"36"
mongo_db_config
=
"36"
...
...
script/ji_yun_ying_pc/service_education_liuqin/Common/__init__.py
0 → 100644
View file @
982db369
script/ji_yun_ying_pc/service_education_liuqin/Common/helpler.py
0 → 100644
View file @
982db369
import
random
import
time
import
datetime
def
get_mobile
():
"""获取手机号"""
mobile
=
'1'
+
random
.
choice
([
'3'
,
'5'
,
'7'
,
'8'
,
'9'
])
for
i
in
range
(
9
):
num
=
random
.
randint
(
0
,
9
)
mobile
+=
str
(
num
)
return
mobile
def
get_time
():
# 获取当前时间cuo
ts
=
str
(
int
(
time
.
time
()))
return
ts
def
get_now_time
():
# 获取当前时间
now_time
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H_
%
M_
%
S"
)
return
now_time
def
get_tomorrow_datetime
():
# 获取明天日期
temp_date
=
datetime
.
datetime
.
now
()
# 获取当前时间 年月日时分秒
date1
=
(
temp_date
+
datetime
.
timedelta
(
days
=+
1
))
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
return
date1
def
get_today
():
# 获取今天
today
=
time
.
strftime
(
"
%
Y-
%
m-
%
d"
,
time
.
localtime
())
return
today
def
get_this_week
():
# 获取当前日期星期
now
=
datetime
.
datetime
.
now
()
this_week_start
=
now
-
datetime
.
timedelta
(
days
=
now
.
weekday
())
this_week_end
=
now
+
datetime
.
timedelta
(
days
=
6
-
now
.
weekday
())
week_start
=
this_week_start
.
strftime
(
"
%
Y-
%
m-
%
d"
)
week_end
=
this_week_end
.
strftime
(
"
%
Y-
%
m-
%
d"
)
return
{
'week_start'
:
week_start
,
'week_end'
:
week_end
}
def
get_this_month
():
# 获取当前日期月
now
=
datetime
.
datetime
.
now
()
this_month_start
=
datetime
.
datetime
(
now
.
year
,
now
.
month
,
1
)
this_month_end
=
datetime
.
datetime
(
now
.
year
,
now
.
month
+
1
,
1
)
-
datetime
.
timedelta
(
days
=
1
)
+
datetime
.
timedelta
(
hours
=
23
,
minutes
=
59
,
seconds
=
59
)
month_start
=
this_month_start
.
strftime
(
"
%
Y-
%
m-
%
d"
)
month_end
=
this_month_end
.
strftime
(
"
%
Y-
%
m-
%
d"
)
return
{
'month_start'
:
month_start
,
'month_end'
:
month_end
}
def
time_transform_day
(
change_time
):
# createTime: 1620387156 转换为2021-05-07 (时间戳转换为日期格式)
day
=
time
.
localtime
(
change_time
)
day
=
time
.
strftime
(
"
%
Y-
%
m-
%
d"
,
day
)
return
day
def
day_transform_time
(
change_time
):
# createTimeStr: "2021-05-07 19:32:36" 转换为 2021-05-07 (格式转换为日期格式)
timeStruct
=
time
.
strptime
(
change_time
,
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
timeStruct
=
time
.
strftime
(
"
%
Y-
%
m-
%
d"
,
timeStruct
)
return
timeStruct
if
__name__
==
'__main__'
:
print
(
get_now_time
())
# print(get_time())
# # print(get_tomorrow_datetime())
# # print(get_this_week())
# # print(get_this_month())
# print(time_transform_day(1620387156))
# print(day_transform_time("2021-05-07 19:32:36"))
script/ji_yun_ying_pc/service_education_liuqin/__init__.py
0 → 100644
View file @
982db369
script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin/Course_Data.py
0 → 100644
View file @
982db369
import
random
from
decimal
import
Decimal
from
script.ji_yun_ying_pc.service_education_liuqin.Common.helpler
import
get_now_time
class
Add_My_New_Clue_isNotTerm
():
# 新增课程data,按课时收费
area
=
2382
schoolArea
=
2371
subject
=
(
"数学"
,
"语文"
,
"英语"
,
"物理"
,
"化学"
)
classType
=
(
"极趣班"
,
"极思班"
,
"极智班"
,
"极客班"
,
"极客A班"
,
"极客蓝队班"
,
"五四极趣班"
,
"五四极思班"
,
"五四极智班"
,
"新生"
,
"人教班"
,
"八人精品"
,
"定制班"
,
"五四极客班"
)
grade_list
=
[
'零年级'
,
'一年级'
,
'二年级'
,
'三年级'
,
'四年级'
,
'五年级'
,
'六年级'
,
'七年级'
,
'八年级'
,
'九年级'
,
'高一'
,
'高二'
,
'高三'
]
# "courseStatus": "2" 停用 "1" 启用
# "isNormal": 2 低价课程 1 正价课程
def
__init__
(
self
,
courseName
=
""
,
term
=
"暑"
,
subject
=
random
.
sample
(
subject
,
1
)[
0
],
productType
=
""
,
year
=
2021
,
classType
=
random
.
sample
(
classType
,
1
)[
0
],
grade
=
random
.
sample
(
grade_list
,
1
)[
0
],
coursePeriod
=
"4"
,
courseType
=
"常规班课"
,
courseNumber
=
"2"
,
normalPrice
=
"15"
,
coursePrice
=
"15"
,
courseStatus
=
"1"
,
teachForm
=
"offline"
,
courseDesc
=
""
,
priceType
=
1
,
isTerm
=
False
,
perPeriodDuration
=
1
,
isNormal
=
1
,
schools
=
[{
"area"
:
area
,
"schoolArea"
:
schoolArea
}],
cContent
=
[]
):
courseName
=
"【面授】{}{}{}{}[lq]{}"
.
format
(
term
,
grade
,
subject
,
classType
,
get_now_time
())
self
.
init_course_data
=
[
{
"courseName"
:
courseName
,
"term"
:
term
,
"subject"
:
subject
,
"productType"
:
productType
,
"year"
:
year
,
"classType"
:
classType
,
"grade"
:
grade
,
"coursePeriod"
:
coursePeriod
,
"courseType"
:
courseType
,
"courseNumber"
:
courseNumber
,
"normalPrice"
:
normalPrice
,
"coursePrice"
:
coursePrice
,
"courseStatus"
:
courseStatus
,
"teachForm"
:
teachForm
,
"courseDesc"
:
courseDesc
,
"priceType"
:
priceType
,
"isTerm"
:
isTerm
,
"perPeriodDuration"
:
perPeriodDuration
,
"isNormal"
:
isNormal
,
"totalPrice"
:
float
(
coursePeriod
)
*
float
(
coursePrice
),
"registerGrade"
:
grade
,
"schools"
:
schools
,
"cContent"
:
cContent
}]
class
Add_My_New_Clue_isTerm
():
# 新增课程data,按期收费
area
=
2382
schoolArea
=
2371
subject
=
(
"数学"
,
"语文"
,
"英语"
,
"物理"
,
"化学"
)
classType
=
(
"极趣班"
,
"极思班"
,
"极智班"
,
"极客班"
,
"极客A班"
,
"极客蓝队班"
,
"五四极趣班"
,
"五四极思班"
,
"五四极智班"
,
"新生"
,
"人教班"
,
"八人精品"
,
"定制班"
,
"五四极客班"
)
grade_list
=
[
'零年级'
,
'一年级'
,
'二年级'
,
'三年级'
,
'四年级'
,
'五年级'
,
'六年级'
,
'七年级'
,
'八年级'
,
'九年级'
,
'高一'
,
'高二'
,
'高三'
]
def
__init__
(
self
,
courseName
=
""
,
term
=
"暑"
,
subject
=
random
.
sample
(
subject
,
1
)[
0
],
productType
=
""
,
year
=
2021
,
classType
=
random
.
sample
(
classType
,
1
)[
0
],
grade
=
random
.
sample
(
grade_list
,
1
)[
0
],
coursePeriod
=
"3"
,
courseType
=
"常规班课"
,
courseNumber
=
"3"
,
normalPrice
=
"100"
,
courseStatus
=
"1"
,
teachForm
=
"offline"
,
totalPrice
=
"44"
,
courseDesc
=
""
,
priceType
=
2
,
perPeriodDuration
=
1
,
isNormal
=
1
,
schools
=
[{
"area"
:
area
,
"schoolArea"
:
schoolArea
}],
cContent
=
[]
):
courseName
=
"【面授】{}{}{}{}[lq按期]{}"
.
format
(
term
,
grade
,
subject
,
classType
,
get_now_time
())
self
.
init_course_data
=
[
{
"courseName"
:
courseName
,
"term"
:
term
,
"subject"
:
subject
,
"productType"
:
productType
,
"year"
:
year
,
"classType"
:
classType
,
"grade"
:
grade
,
"coursePeriod"
:
coursePeriod
,
"courseType"
:
courseType
,
"courseNumber"
:
courseNumber
,
"normalPrice"
:
normalPrice
,
"coursePrice"
:
'{:.2f}'
.
format
(
float
(
Decimal
(
totalPrice
)
/
Decimal
(
coursePeriod
))),
"courseStatus"
:
courseStatus
,
"teachForm"
:
teachForm
,
"courseDesc"
:
courseDesc
,
"priceType"
:
priceType
,
"perPeriodDuration"
:
perPeriodDuration
,
"isNormal"
:
isNormal
,
"totalPrice"
:
totalPrice
,
"registerGrade"
:
grade
,
"schools"
:
schools
,
"cContent"
:
cContent
}]
if
__name__
==
'__main__'
:
totalPrice
=
Decimal
(
"44"
)
coursePeriod
=
Decimal
(
"3"
)
print
(
type
(
str
(
totalPrice
/
coursePeriod
)))
script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin/__init__.py
0 → 100644
View file @
982db369
script/ji_yun_ying_pc/service_education_liuqin/courses_liuqin/test_case_course.py
0 → 100644
View file @
982db369
from
pytest_assume.plugin
import
assume
from
script.base_api
import
education_courses_add_post
,
education_courses_query_post
from
script.default_header
import
jyy_header
from
script.ji_yun_ying_pc.service_education_liuqin.courses_liuqin.Course_Data
import
Add_My_New_Clue_isNotTerm
,
\
Add_My_New_Clue_isTerm
class
TestCourse
():
"""
测试[教务_课程]
"""
# 验证新增内容课后自动成为商品
# 验证新增【不分段常规班课课程】---所有项
def
test_create_course_with_all_condition_success
(
self
):
json_data
=
Add_My_New_Clue_isNotTerm
()
.
init_course_data
# 获取新建课程的参数
courseName
=
json_data
[
0
][
'courseName'
],
term
=
json_data
[
0
][
'term'
],
subject
=
json_data
[
0
][
'subject'
],
productType
=
json_data
[
0
][
'productType'
],
year
=
json_data
[
0
][
'year'
],
classType
=
json_data
[
0
][
'classType'
],
grade
=
json_data
[
0
][
'grade'
],
registerGrade
=
json_data
[
0
][
'registerGrade'
],
coursePeriod
=
json_data
[
0
][
'coursePeriod'
],
courseType
=
json_data
[
0
][
'courseType'
],
courseNumber
=
json_data
[
0
][
'courseNumber'
],
normalPrice
=
json_data
[
0
][
'normalPrice'
],
coursePrice
=
json_data
[
0
][
'coursePrice'
],
totalPrice
=
json_data
[
0
][
'totalPrice'
],
courseStatus
=
json_data
[
0
][
'courseStatus'
],
teachForm
=
json_data
[
0
][
'teachForm'
],
courseDesc
=
json_data
[
0
][
'courseDesc'
],
priceType
=
json_data
[
0
][
'priceType'
],
isTerm
=
json_data
[
0
][
'isTerm'
],
perPeriodDuration
=
json_data
[
0
][
'perPeriodDuration'
],
isNormal
=
json_data
[
0
][
'isNormal'
],
schools
=
json_data
[
0
][
'schools'
],
cContent
=
json_data
[
0
][
'cContent'
]
# 新增课程
try
:
add_res
=
education_courses_add_post
(
body
=
json_data
,
header
=
jyy_header
)
with
assume
:
assert
add_res
[
'code'
]
==
0
with
assume
:
assert
add_res
[
'msg'
]
==
'成功'
except
:
print
(
'新建课程失败'
)
raise
# 查询课程
try
:
schoolAreas
=
schools
[
0
][
0
]
schoolAreas
=
schoolAreas
[
'schoolArea'
]
print
(
schoolAreas
)
query_data
=
{
"type"
:
"not-click"
,
"schoolAreas"
:[
schoolAreas
]}
params
=
{
'pageNum'
:
1
,
'pageSize'
:
10
}
query_res
=
education_courses_query_post
(
params
=
params
,
body
=
query_data
,
header
=
jyy_header
)
res_first_course_data
=
query_res
[
'data'
][
'content'
][
0
]
with
assume
:
assert
query_res
[
'code'
]
==
0
with
assume
:
assert
query_res
[
'msg'
]
==
'成功'
with
assume
:
assert
res_first_course_data
[
'classType'
]
==
classType
[
0
]
with
assume
:
assert
res_first_course_data
[
'courseDesc'
]
==
courseDesc
[
0
]
with
assume
:
assert
res_first_course_data
[
'courseName'
]
==
courseName
[
0
]
with
assume
:
assert
res_first_course_data
[
'courseNumber'
]
==
int
(
courseNumber
[
0
])
with
assume
:
assert
res_first_course_data
[
'coursePeriod'
]
==
float
(
coursePeriod
[
0
])
with
assume
:
assert
res_first_course_data
[
'coursePrice'
]
==
float
(
coursePrice
[
0
])
with
assume
:
assert
res_first_course_data
[
'courseType'
]
==
courseType
[
0
]
with
assume
:
assert
res_first_course_data
[
'grade'
]
==
grade
[
0
]
with
assume
:
assert
res_first_course_data
[
'isNormal'
]
==
isNormal
[
0
]
with
assume
:
assert
res_first_course_data
[
'normalPrice'
]
==
float
(
normalPrice
[
0
])
with
assume
:
assert
res_first_course_data
[
'perPeriodDuration'
]
==
perPeriodDuration
[
0
]
with
assume
:
assert
res_first_course_data
[
'priceType'
]
==
priceType
[
0
]
with
assume
:
assert
res_first_course_data
[
'productType'
]
==
productType
[
0
]
with
assume
:
assert
res_first_course_data
[
'registerGrade'
]
==
registerGrade
[
0
]
with
assume
:
assert
res_first_course_data
[
'subject'
]
==
subject
[
0
]
with
assume
:
assert
res_first_course_data
[
'teachForm'
]
==
teachForm
[
0
]
with
assume
:
assert
res_first_course_data
[
'term'
]
==
term
[
0
]
with
assume
:
assert
res_first_course_data
[
'totalPrice'
]
==
totalPrice
[
0
]
with
assume
:
assert
res_first_course_data
[
'year'
]
==
year
[
0
]
except
:
print
(
'查询课程失败'
)
raise
# 验证新增【不分段常规班课课程】---按期收费
def
test_create_course_by_term_success
(
self
):
json_data
=
Add_My_New_Clue_isTerm
()
.
init_course_data
# 获取新建课程的参数
courseName
=
json_data
[
0
][
'courseName'
],
term
=
json_data
[
0
][
'term'
],
subject
=
json_data
[
0
][
'subject'
],
productType
=
json_data
[
0
][
'productType'
],
year
=
json_data
[
0
][
'year'
],
classType
=
json_data
[
0
][
'classType'
],
grade
=
json_data
[
0
][
'grade'
],
registerGrade
=
json_data
[
0
][
'registerGrade'
],
coursePeriod
=
json_data
[
0
][
'coursePeriod'
],
courseType
=
json_data
[
0
][
'courseType'
],
courseNumber
=
json_data
[
0
][
'courseNumber'
],
normalPrice
=
json_data
[
0
][
'normalPrice'
],
coursePrice
=
json_data
[
0
][
'coursePrice'
],
totalPrice
=
json_data
[
0
][
'totalPrice'
],
courseStatus
=
json_data
[
0
][
'courseStatus'
],
teachForm
=
json_data
[
0
][
'teachForm'
],
courseDesc
=
json_data
[
0
][
'courseDesc'
],
priceType
=
json_data
[
0
][
'priceType'
],
perPeriodDuration
=
json_data
[
0
][
'perPeriodDuration'
],
isNormal
=
json_data
[
0
][
'isNormal'
],
schools
=
json_data
[
0
][
'schools'
],
cContent
=
json_data
[
0
][
'cContent'
]
try
:
add_res
=
education_courses_add_post
(
body
=
json_data
,
header
=
jyy_header
)
with
assume
:
assert
add_res
[
'code'
]
==
0
with
assume
:
assert
add_res
[
'msg'
]
==
'成功'
except
:
print
(
'新建课程失败'
)
raise
try
:
schoolAreas
=
schools
[
0
][
0
]
schoolAreas
=
schoolAreas
[
'schoolArea'
]
print
(
schoolAreas
)
query_data
=
{
"type"
:
"not-click"
,
"schoolAreas"
:[
schoolAreas
]}
params
=
{
'pageNum'
:
1
,
'pageSize'
:
10
}
query_res
=
education_courses_query_post
(
params
=
params
,
body
=
query_data
,
header
=
jyy_header
)
res_first_course_data
=
query_res
[
'data'
][
'content'
][
0
]
with
assume
:
assert
query_res
[
'code'
]
==
0
with
assume
:
assert
query_res
[
'msg'
]
==
'成功'
with
assume
:
assert
res_first_course_data
[
'classType'
]
==
classType
[
0
]
with
assume
:
assert
res_first_course_data
[
'courseDesc'
]
==
courseDesc
[
0
]
with
assume
:
assert
res_first_course_data
[
'courseName'
]
==
courseName
[
0
]
with
assume
:
assert
res_first_course_data
[
'courseNumber'
]
==
int
(
courseNumber
[
0
])
with
assume
:
assert
res_first_course_data
[
'coursePeriod'
]
==
float
(
coursePeriod
[
0
])
with
assume
:
assert
res_first_course_data
[
'coursePrice'
]
==
float
(
coursePrice
[
0
])
with
assume
:
assert
res_first_course_data
[
'courseType'
]
==
courseType
[
0
]
with
assume
:
assert
res_first_course_data
[
'grade'
]
==
grade
[
0
]
with
assume
:
assert
res_first_course_data
[
'isNormal'
]
==
isNormal
[
0
]
with
assume
:
assert
res_first_course_data
[
'normalPrice'
]
==
float
(
normalPrice
[
0
])
with
assume
:
assert
res_first_course_data
[
'perPeriodDuration'
]
==
perPeriodDuration
[
0
]
with
assume
:
assert
res_first_course_data
[
'priceType'
]
==
priceType
[
0
]
with
assume
:
assert
res_first_course_data
[
'productType'
]
==
productType
[
0
]
with
assume
:
assert
res_first_course_data
[
'registerGrade'
]
==
registerGrade
[
0
]
with
assume
:
assert
res_first_course_data
[
'subject'
]
==
subject
[
0
]
with
assume
:
assert
res_first_course_data
[
'teachForm'
]
==
teachForm
[
0
]
with
assume
:
assert
res_first_course_data
[
'term'
]
==
term
[
0
]
with
assume
:
assert
res_first_course_data
[
'totalPrice'
]
==
float
(
totalPrice
[
0
])
with
assume
:
assert
res_first_course_data
[
'year'
]
==
year
[
0
]
except
:
print
(
'查询课程失败'
)
raise
# 验证新增【不分段常规班课课程】---标准价>=现价的限制
def
test_create_course_with_coursePrice_bigger_than_normalPrice_failure
(
self
):
json_data
=
Add_My_New_Clue_isNotTerm
(
normalPrice
=
"15"
,
coursePrice
=
'16'
)
.
init_course_data
try
:
add_res
=
education_courses_add_post
(
body
=
json_data
,
header
=
jyy_header
)
with
assume
:
assert
add_res
[
'code'
]
==
-
1
with
assume
:
assert
add_res
[
'msg'
]
==
'失败'
except
:
print
(
'新建课程失败'
)
raise
# 验证新增【不分段常规班课课程】---现价*总课时!=总价----fail
def
test_create_course_with_totalPrice_bigger_failure
(
self
):
json_data
=
Add_My_New_Clue_isNotTerm
(
coursePrice
=
"15"
,
coursePeriod
=
"4"
)
.
init_course_data
json_data
[
0
][
'totalPrice'
]
=
"200"
try
:
add_res
=
education_courses_add_post
(
body
=
json_data
,
header
=
jyy_header
)
with
assume
:
assert
add_res
[
'code'
]
==
-
1
with
assume
:
assert
add_res
[
'msg'
]
==
'失败'
except
:
print
(
'新建课程失败'
)
raise
# 验证新增【不分段常规班课课程】---价格为负数
def
test_create_course_with_negative_price_failure
(
self
):
json_data
=
Add_My_New_Clue_isNotTerm
(
coursePrice
=
"-20"
)
.
init_course_data
print
(
json_data
)
try
:
add_res
=
education_courses_add_post
(
body
=
json_data
,
header
=
jyy_header
)
with
assume
:
assert
add_res
[
'code'
]
==
-
1
with
assume
:
assert
add_res
[
'msg'
]
==
'失败'
except
:
print
(
'新建课程失败'
)
raise
# 验证新增【不分段常规班课课程】---网报年级与课程年级不匹配---fail
def
test_create_course_with_wrong_registerGrade_failure
(
self
):
json_data
=
Add_My_New_Clue_isNotTerm
(
grade
=
"三年级"
)
.
init_course_data
json_data
[
0
][
'registerGrade'
]
=
"六年级"
print
(
json_data
)
try
:
add_res
=
education_courses_add_post
(
body
=
json_data
,
header
=
jyy_header
)
with
assume
:
assert
add_res
[
'code'
]
==
-
1
with
assume
:
assert
add_res
[
'msg'
]
==
'失败'
except
:
print
(
'新建课程失败'
)
raise
# 验证新增【不分段常规班课课程】---每课时分钟数设置为负数---fail
def
test_create_course_with_negative_coursePeriod_failure
(
self
):
json_data
=
Add_My_New_Clue_isNotTerm
(
coursePeriod
=
"-4"
,
courseNumber
=
"-2"
)
.
init_course_data
print
(
json_data
)
try
:
add_res
=
education_courses_add_post
(
body
=
json_data
,
header
=
jyy_header
)
with
assume
:
assert
add_res
[
'code'
]
==
-
1
with
assume
:
assert
add_res
[
'msg'
]
==
'失败'
except
:
print
(
'新建课程失败'
)
raise
# 验证新增【不分段常规班课课程】---计划排课数与总课时限制
def
test_create_course_with_wrong_courseNumber_failure
(
self
):
json_data
=
Add_My_New_Clue_isNotTerm
(
coursePeriod
=
"4"
,
courseNumber
=
"1.3"
)
.
init_course_data
print
(
json_data
)
try
:
add_res
=
education_courses_add_post
(
body
=
json_data
,
header
=
jyy_header
)
with
assume
:
assert
add_res
[
'code'
]
==
-
1
with
assume
:
assert
add_res
[
'msg'
]
==
'新增课程失败!'
except
:
print
(
'新建课程失败'
)
raise
# 验证新增【不分段常规班课课程】---低价课程
def
test_create_course_with_low_price
(
self
):
json_data
=
Add_My_New_Clue_isNotTerm
(
isNormal
=
2
)
.
init_course_data
isNormal
=
json_data
[
0
][
'isNormal'
]
schools
=
json_data
[
0
][
'schools'
]
print
(
schools
)
try
:
add_res
=
education_courses_add_post
(
body
=
json_data
,
header
=
jyy_header
)
with
assume
:
assert
add_res
[
'code'
]
==
0
with
assume
:
assert
add_res
[
'msg'
]
==
'成功'
except
:
print
(
'新建课程失败'
)
raise
try
:
schoolAreas
=
schools
[
0
]
schoolAreas
=
schoolAreas
[
'schoolArea'
]
query_data
=
{
"type"
:
"not-click"
,
"schoolAreas"
:[
schoolAreas
]}
params
=
{
'pageNum'
:
1
,
'pageSize'
:
10
}
query_res
=
education_courses_query_post
(
params
=
params
,
body
=
query_data
,
header
=
jyy_header
)
res_first_course_data
=
query_res
[
'data'
][
'content'
][
0
]
with
assume
:
assert
add_res
[
'code'
]
==
0
with
assume
:
assert
add_res
[
'msg'
]
==
'成功'
with
assume
:
assert
res_first_course_data
[
'isNormal'
]
==
isNormal
except
:
print
(
'查询课程失败'
)
raise
# 验证新增【分段常规班课课程】---正价课程
# 验证新增【分段常规班课课程】---低价课程
# 验证新增【分段常规班课课程】---学期 传非法值
# 验证新增【分段常规班课课程】---科目 传非法值
# 验证新增【分段常规班课课程】---年级 传非法值
# 验证新增【分段常规班课课程】---课型与班型不匹配
# 验证新增【不分段常规班课课程】---停用
# 验证新增【精品定制课程】
# 验证新增【集训班课程】
# 验证新增【专题班课程】
# 验证新增【服务班课程】
# 验证复制课程正确
# 验证修改课程正确--所有项
# 验证修改课程正确--必填项
# 验证修改课程价格
# 验证启用课程
# 验证停用课程
# 验证删除课程
# 验证搜索课程---按课程名称
# 验证搜索课程---按课程ID
# 验证搜索课程---按班型
# 验证搜索课程---按年份
# 验证搜索课程---按学期
# 验证搜索课程---按年级
# 验证搜索课程---按科目
# 验证搜索课程---按状态
# 验证课程上传资料
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment