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
5a80c2c3
Commit
5a80c2c3
authored
Apr 16, 2021
by
小刘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
选课中心班级信息显示
parent
bae3d858
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
322 additions
and
6 deletions
+322
-6
test_auth_choose_class.py
...iarch_app/test_xin_choose_class/test_auth_choose_class.py
+135
-2
test_auth_choose_class_details.py
...p/test_xin_choose_class/test_auth_choose_class_details.py
+0
-0
test_auth_update_choose_class.py
...pp/test_xin_choose_class/test_auth_update_choose_class.py
+182
-0
xin_update_class.py
...atic/xin_educational/xin_class_handle/xin_update_class.py
+2
-2
xin_update_course.py
...ic/xin_educational/xin_course_handle/xin_update_course.py
+3
-2
No files found.
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_choose_class.py
View file @
5a80c2c3
...
...
@@ -23,7 +23,7 @@ from script.xin_project_patriarch_app.xin_static.xin_time import Time_get
@allure.epic
(
'家长APP接口自动化测试'
)
@allure.feature
(
'选课中心'
)
@allure.feature
(
'选课中心
-显示规则
'
)
class
TestChooseClasses
:
global_class_id
=
None
...
...
@@ -359,7 +359,6 @@ class TestChooseClasses:
])
.
pay_order
()
time
.
sleep
(
2
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
print
(
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
))
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
'极趣班'
not
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
with
assume
:
assert
'专题'
in
jsonpath
.
jsonpath
(
choose_data
,
'$..classType'
)
...
...
@@ -432,3 +431,137 @@ class TestChooseClasses:
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
class_id
with
assume
:
assert
assert_data
.
get
(
'signUp'
)
is
True
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'验证专题满员,显示满员标签'
)
@allure.description
(
'验证专题满员,显示满员标签'
)
def
test_choose_one_buy_class_two_show
(
self
):
userId_list
=
[]
for
student_count
in
range
(
2
):
studentPho
=
'1783'
+
str
(
time
.
time
())
.
split
(
'.'
)[
1
]
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId_list
.
append
(
userId
)
# 等待,请求快后端直减判定重复提交
time
.
sleep
(
0.5
)
course_id
=
CreateCourse
(
server
=
self
.
server
,
productType
=
'副线课程'
,
classType
=
'专题'
,
courseType
=
'专题班课'
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
,
courseNumber
=
1
,
totalPrice
=
10
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
classStudentNum
=
1
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
class_id
])
.
network_set
()
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId_list
[
0
],
amount
=
10
,
details
=
[{
"classId"
:
class_id
,
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
10
}
])
.
pay_order
()
time
.
sleep
(
2
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId_list
[
1
],
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
.
get
(
'data'
),
'id'
,
class_id
)
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
class_id
with
assume
:
assert
assert_data
.
get
(
'fullClass'
)
is
True
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'验证新生班满员,不显示满员标签'
)
@allure.description
(
'验证新生班满员,不显示满员标签'
)
def
test_choose_one_buy_now_class_two_not_show
(
self
):
userId_list
=
[]
for
student_count
in
range
(
2
):
studentPho
=
'1782'
+
str
(
time
.
time
())
.
split
(
'.'
)[
1
]
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId_list
.
append
(
userId
)
course_id
=
CreateCourse
(
server
=
self
.
server
,
productType
=
'主线课程'
,
classType
=
'新生'
,
courseType
=
'常规班课'
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
,
courseNumber
=
1
,
totalPrice
=
10
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
classStudentNum
=
1
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
class_id
])
.
network_set
()
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId_list
[
0
],
amount
=
10
,
details
=
[{
"classId"
:
class_id
,
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
10
}
])
.
pay_order
()
time
.
sleep
(
2
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId_list
[
1
],
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
.
get
(
'data'
),
'id'
,
class_id
)
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
class_id
with
assume
:
assert
assert_data
.
get
(
'fullClass'
)
is
False
@allure.story
(
'选课列表-班级'
)
@allure.title
(
'验证常规班满员,显示满员标签'
)
@allure.description
(
'验证常规班满员,显示满员标签'
)
def
test_choose_one_buy_groove_two_show
(
self
):
userId_list
=
[]
for
student_count
in
range
(
2
):
studentPho
=
'1731'
+
str
(
time
.
time
())
.
split
(
'.'
)[
1
]
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
studentPho
)
.
create_student
()
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
userId_list
.
append
(
userId
)
class_list
=
[]
for
class_count
in
range
(
2
):
course_id
=
CreateCourse
(
server
=
self
.
server
,
productType
=
'副线课程'
,
classType
=
'专题'
,
courseType
=
'专题班课'
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
,
courseNumber
=
1
,
totalPrice
=
10
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
classStudentNum
=
1
)
.
create_class
()[
'classId'
]
class_list
.
append
(
class_id
)
NetWork
(
server
=
self
.
server
,
resignClassIds
=
class_list
)
.
network_set
()
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId_list
[
0
],
amount
=
10
,
details
=
[{
"classId"
:
class_list
[
0
],
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
10
}
])
.
pay_order
()
order_id_two
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
userId_list
[
1
],
amount
=
10
,
details
=
[{
"classId"
:
class_list
[
1
],
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id_two
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
10
}
])
.
pay_order
()
time
.
sleep
(
1
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
userId_list
[
1
],
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
.
get
(
'data'
),
'id'
,
class_list
[
0
])
with
assume
:
assert
choose_data
[
'code'
]
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
class_list
[
0
]
with
assume
:
assert
assert_data
.
get
(
'fullClass'
)
is
True
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_choose_class_details.py
0 → 100644
View file @
5a80c2c3
script/xin_project_patriarch_app/xin_patriarch_app/test_xin_choose_class/test_auth_update_choose_class.py
0 → 100644
View file @
5a80c2c3
import
datetime
import
time
import
allure
from
pytest_assume.plugin
import
assume
from
script.xin_project_patriarch_app.xin_patriarch_app.xin_patriach_static.xin_choose_class.xin_choose_classes
import
ChooseClasses
from
script.xin_project_patriarch_app.xin_patriarch_app.xin_patriach_static.xin_public_class.xin_change_list_index
import
ChangeListIndex
from
script.xin_project_patriarch_app.xin_patriarch_app.xin_patriach_static.xin_public_class.xin_global_static
import
StaticGlobal
from
script.xin_project_patriarch_app.xin_static.xin_crm.xin_apply.xin_pay_order
import
PayOrder
from
script.xin_project_patriarch_app.xin_static.xin_crm.xin_apply.xin_save_order
import
SaveOrder
from
script.xin_project_patriarch_app.xin_static.xin_crm.xin_student
import
CreateStudent
from
script.xin_project_patriarch_app.xin_static.xin_educational.xin_class_handle.xin_add_class
import
CreateClass
from
script.xin_project_patriarch_app.xin_static.xin_educational.xin_class_handle.xin_update_class
import
UpdateClass
from
script.xin_project_patriarch_app.xin_static.xin_educational.xin_course_handle.xin_course
import
CreateCourse
from
script.xin_project_patriarch_app.xin_static.xin_educational.xin_course_handle.xin_update_course
import
UpdateCoursePrice
from
script.xin_project_patriarch_app.xin_static.xin_educational.xin_network
import
NetWork
from
script.xin_project_patriarch_app.xin_static.xin_time
import
Time_get
@allure.epic
(
'家长APP接口自动化测试'
)
@allure.feature
(
'选课中心-班级信息'
)
class
TestAuthUpdateChooseClass
:
def
setup_class
(
self
):
self
.
server
=
StaticGlobal
.
SERVER
self
.
schoolArea
=
StaticGlobal
.
SCHOOL
self
.
studentPho
=
'189'
+
datetime
.
datetime
.
now
()
.
strftime
(
'
%
d
%
H
%
M
%
S'
)
students_data
=
CreateStudent
(
server
=
self
.
server
,
contactInfo
=
self
.
studentPho
)
.
create_student
()
self
.
userId
=
students_data
[
'data'
][
'list'
][
0
][
'studentId'
]
"""
购买一个常规班
"""
course_id
=
CreateCourse
(
server
=
self
.
server
,
classType
=
'极趣班'
,
courseType
=
'常规班课'
,
productType
=
'主线课程'
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
,
courseNumber
=
1
,
totalPrice
=
10
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
self
.
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
schoolArea
=
self
.
schoolArea
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
self
.
class_id
])
.
network_set
()
order_id
=
SaveOrder
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
amount
=
10
,
details
=
[{
"classId"
:
self
.
class_id
,
"num"
:
10
,
"discountId"
:
""
,
"category"
:
"CLASS"
}])
.
save_order
()[
'data'
]
PayOrder
(
server
=
self
.
server
,
orderId
=
order_id
,
payInfos
=
[
{
"payChannel"
:
"CASH"
,
"payAmount"
:
10
}
])
.
pay_order
()
time
.
sleep
(
3
)
@allure.story
(
'选课列表-班级信息'
)
@allure.title
(
'班级名称显示正确'
)
@allure.description
(
'验证班级名称显示正确'
)
def
test_update_before_choose_class_name
(
self
):
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
[
'data'
],
'id'
,
self
.
class_id
)
with
assume
:
assert
choose_data
.
get
(
'code'
)
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
self
.
class_id
with
assume
:
assert
assert_data
.
get
(
'name'
)
==
f
'小黄测试极趣班{StaticGlobal.YEAR}{StaticGlobal.TERM}数学'
with
assume
:
assert
assert_data
.
get
(
'grade'
)
==
'三年级'
@allure.story
(
'选课列表-班级信息'
)
@allure.title
(
'修改班级名称后显示正确'
)
@allure.description
(
'验证修改班级名称后显示正确'
)
def
test_update_after_choose_class_name
(
self
):
UpdateClass
(
server
=
self
.
server
,
classId
=
self
.
class_id
)
.
update_class_className
(
value
=
'这是选课中心修改后班级名称'
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
[
'data'
],
'id'
,
self
.
class_id
)
with
assume
:
assert
choose_data
.
get
(
'code'
)
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
self
.
class_id
with
assume
:
assert
assert_data
.
get
(
'name'
)
==
'这是选课中心修改后班级名称'
@allure.story
(
'选课列表-班级信息'
)
@allure.title
(
'验证没有老师返回为空'
)
@allure.description
(
'验证没有老师返回为空正确'
)
def
test_update_before_choose_class_teacher
(
self
):
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
[
'data'
],
'id'
,
self
.
class_id
)
with
assume
:
assert
choose_data
.
get
(
'code'
)
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
self
.
class_id
with
assume
:
assert
assert_data
.
get
(
'teacherId'
)
is
None
with
assume
:
assert
assert_data
.
get
(
'teacherName'
)
is
None
@allure.story
(
'选课列表-班级信息'
)
@allure.title
(
'验证修改老师后显示正确'
)
@allure.description
(
'验证修改老师后显示正确'
)
def
test_update_after_choose_class_teacher
(
self
):
UpdateClass
(
server
=
self
.
server
,
classId
=
self
.
class_id
)
.
update_class_teacher
(
value
=
{
"id"
:
9384
,
"name"
:
"刘黄鑫"
})
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
[
'data'
],
'id'
,
self
.
class_id
)
with
assume
:
assert
choose_data
.
get
(
'code'
)
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
self
.
class_id
with
assume
:
assert
assert_data
.
get
(
'teacherId'
)
==
9384
with
assume
:
assert
assert_data
.
get
(
'teacherName'
)
==
'刘黄鑫'
@allure.story
(
'选课列表-班级信息'
)
@allure.title
(
'验证总课时正确'
)
@allure.description
(
'验证总课时正确'
)
def
test_choose_class_course_number
(
self
):
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
[
'data'
],
'id'
,
self
.
class_id
)
with
assume
:
assert
choose_data
.
get
(
'code'
)
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
self
.
class_id
with
assume
:
assert
assert_data
.
get
(
'lessonQty'
)
==
1
with
assume
:
assert
assert_data
.
get
(
'periodQty'
)
==
10.0
@allure.story
(
'选课列表-班级信息'
)
@allure.title
(
'没有排课时间,显示正确'
)
@allure.description
(
'没有排课显示正确'
)
def
test_update_before_choose_class_time
(
self
):
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
[
'data'
],
'id'
,
self
.
class_id
)
with
assume
:
assert
choose_data
.
get
(
'code'
)
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
self
.
class_id
with
assume
:
assert
assert_data
.
get
(
'beginDate'
)
==
Time_get
.
get_before_week_time_start
()
with
assume
:
assert
assert_data
.
get
(
'endDate'
)
==
'2099-12-31'
@allure.story
(
'选课列表-班级信息'
)
@allure.title
(
'修改排课时间,显示正确'
)
@allure.description
(
'修改排课时间显示正确'
)
def
test_update_after_choose_class_time
(
self
):
UpdateClass
(
server
=
self
.
server
,
classId
=
self
.
class_id
)
.
update_class_classroom
(
value
=
{
"id"
:
10009686
,
"name"
:
"常规全天"
})
UpdateClass
(
server
=
self
.
server
,
classId
=
self
.
class_id
)
.
update_class_teacher
(
value
=
{
"id"
:
9384
,
"name"
:
"刘黄鑫"
})
value
=
[
{
"classScheduleId"
:
0
,
"date"
:
Time_get
.
get_before_week_time_start
()
+
' 00:00:00'
,
"week"
:
"星期一"
,
"beginTime"
:
"07:35:00"
,
"endTime"
:
"07:40:00"
,
"duration"
:
10
,
"classScheduleIndex"
:
1
,
"employeeNumber"
:
"JKTR00397"
,
"classTeacher"
:
"刘黄鑫"
,
"classTeacherId"
:
9384
,
"classroomId"
:
10009686
,
"classroomName"
:
"常规全天"
}
]
UpdateClass
(
server
=
self
.
server
,
classId
=
self
.
class_id
)
.
update_class_schedule
(
classSchedule
=
value
)
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
[
'data'
],
'id'
,
self
.
class_id
)
with
assume
:
assert
choose_data
.
get
(
'code'
)
==
0
with
assume
:
assert
assert_data
.
get
(
'id'
)
==
self
.
class_id
with
assume
:
assert
assert_data
.
get
(
'firstScheduleTime'
)
==
Time_get
.
get_before_week_time_start
()
+
' 07:35:00'
with
assume
:
assert
assert_data
.
get
(
'beginDate'
)
==
Time_get
.
get_before_week_time_start
()
with
assume
:
assert
assert_data
.
get
(
'endDate'
)
==
Time_get
.
get_before_week_time_start
()
with
assume
:
assert
assert_data
.
get
(
'classroomId'
)
==
10009686
with
assume
:
assert
assert_data
.
get
(
'classroomName'
)
==
"常规全天"
with
assume
:
assert
assert_data
.
get
(
'teacherId'
)
==
9384
with
assume
:
assert
assert_data
.
get
(
'teacherName'
)
==
"刘黄鑫"
@allure.story
(
'选课列表-班级信息'
)
@allure.title
(
'修改课程价格,显示正确'
)
@allure.description
(
'修改课程价格,显示正确'
)
def
test_update_choose_class_price
(
self
):
course_id
=
CreateCourse
(
server
=
self
.
server
,
classType
=
'极趣班'
,
courseType
=
'常规班课'
,
productType
=
'主线课程'
,
year
=
StaticGlobal
.
YEAR
,
term
=
StaticGlobal
.
TERM
,
courseNumber
=
1
,
totalPrice
=
10
)
.
create_course
()[
'data'
][
'content'
][
0
][
'courseId'
]
class_id
=
CreateClass
(
server
=
self
.
server
,
courseId
=
course_id
,
schoolArea
=
self
.
schoolArea
)
.
create_class
()[
'classId'
]
NetWork
(
server
=
self
.
server
,
resignClassIds
=
[
class_id
])
.
network_set
()
UpdateCoursePrice
(
server
=
self
.
server
,
courseId
=
course_id
,
isNormal
=
1
,
normalPrice
=
100
,
coursePrice
=
100
)
.
update_course_price
()
choose_data
=
ChooseClasses
(
server
=
self
.
server
,
studentId
=
self
.
userId
,
schoolAreaId
=
self
.
schoolArea
)
.
choose_class
()
assert_data
=
ChangeListIndex
()
.
change_list_index
(
choose_data
[
'data'
],
'id'
,
class_id
)
with
assume
:
assert
choose_data
.
get
(
'code'
)
==
0
with
assume
:
assert
assert_data
.
get
(
'price'
)
==
100.0
with
assume
:
assert
assert_data
.
get
(
'amount'
)
==
100.0
with
assume
:
assert
assert_data
.
get
(
'1000'
)
==
1000.0
script/xin_project_patriarch_app/xin_static/xin_educational/xin_class_handle/xin_update_class.py
View file @
5a80c2c3
...
...
@@ -135,7 +135,7 @@ class UpdateClass:
return
education_classes_optionalUpdate_post
(
body
=
dict
(
fields
,
**
self
.
body
),
header
=
self
.
headers
,
default_assert
=
False
)
# 修改排课
def
update_class_schedule
(
self
,
classSchedule
):
def
update_class_schedule
(
self
,
classSchedule
:
list
):
"""
classSchedule格式如下
[
...
...
@@ -159,7 +159,7 @@ class UpdateClass:
data
=
{
"classSchedule"
:
classSchedule
}
return
education_classes_update_post
(
body
=
d
ata
,
header
=
self
.
headers
,
default_assert
=
False
)
return
education_classes_update_post
(
body
=
d
ict
(
data
,
**
self
.
body
)
,
header
=
self
.
headers
,
default_assert
=
False
)
if
__name__
==
'__main__'
:
...
...
script/xin_project_patriarch_app/xin_static/xin_educational/xin_course_handle/xin_update_course.py
View file @
5a80c2c3
...
...
@@ -15,7 +15,7 @@ def query_course(courseId, headers):
"courseId"
:
courseId
,
"judgeUsed"
:
True
,
}
return
education_courses_queryById_get
(
params
=
query_data
,
header
s
=
headers
,
default_assert
=
False
)
return
education_courses_queryById_get
(
params
=
query_data
,
header
=
headers
,
default_assert
=
False
)
"""
...
...
@@ -136,11 +136,12 @@ class UpdateCoursePrice:
"normalPrice"
:
self
.
normalPrice
or
course_data
[
'data'
][
'course'
][
'normalPrice'
],
"isNormal"
:
self
.
isNormal
or
course_data
[
'data'
][
'course'
][
'isNormal'
],
"coursePrice"
:
self
.
coursePrice
or
course_data
[
'data'
][
'course'
][
'coursePrice'
],
"totalPrice"
:
course_data
[
'data'
][
'course'
][
'totalPrice'
]
if
self
.
coursePrice
is
None
or
course_data
[
'data'
][
'course'
][
'courseType'
]
==
'精品定制课'
"totalPrice"
:
course_data
[
'data'
][
'course'
][
'totalPrice'
]
if
self
.
coursePrice
is
None
else
float
(
course_data
[
'data'
][
'course'
][
'courseNumber'
])
*
self
.
coursePrice
}
if
course_data
[
'data'
][
'course'
][
'courseType'
]
==
'精品定制课'
:
update_price_data
.
pop
(
'isNormal'
)
update_price_data
[
'totalPrice'
]
=
course_data
[
'data'
][
'course'
][
'totalPrice'
]
return
education_courses_modifyPrice_post
(
header
=
self
.
headers
,
body
=
update_price_data
,
default_assert
=
False
)
# return requests.post(url=self.server + self.update_price_url, json=update_price_data, headers=self.headers, verify=False).json()
...
...
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