Example #1
0
from Python_library.SongQin_API import SongQin_API
sc = SongQin_API()


class tc000001:
    def tc000001_steps(self):
        print("""\n\n*** step1 *** 添加7年级二班\n""")
        self.grade__name = "七年级"
        self.studentlimit = 60
        self.name = "2班"
        self.ret1 = sc.add_school_class(
            sc.grade_values_converted_nubers(self.grade__name), self.name,
            self.studentlimit)
        sc.new_assert(self.ret1["retcode"], 0, "添加班级信息")

        print("""\n\n*** step2 ***取出班级添加成功后所返回的id invitecode值,便于对比\n""")
        self.ret1_id = self.ret1["id"]
        self.ret1_invitecode = self.ret1["invitecode"]

        print("""\n\n*** step3 *** 列出当前所有班级进行对比\n""")
        self.ret2 = sc.list_school_class()
        # assert  self.ret2["retlist"][0]["id"] ==self.ret1["id"]
        # assert  self.ret2["retlist"][0]["grade__name"] ==self.grade__name
        # assert  self.ret2["retlist"][0]["studentlimit"] ==self.studentlimit
        # assert  self.ret2["retlist"][0]["name"] ==self.name
        # assert  self.ret2["retlist"][0]["id"] ==self.ret1_id
        # assert  self.ret2["retlist"][0]["invitecode"] ==self.ret1_invitecode

    def tc000001_steup(self):
        pass
Example #2
0
from Python_library.SongQin_API import SongQin_API
import time
ip = SongQin_API()


#添加学生
class tc002002:
    def tc002002_steps(self):
        print("""\n\n*** step1 *** 列出老师,检验一下\n""")
        ip.list_student()
        xinxi = ip.list_school_class()

        print("""\n\n*** step1 *** 添加学生\n""")
        self.add_student = ip.add_student(
            "moxicheng223", "邓辉",
            ip.grade_values_converted_nubers(
                xinxi["retlist"][0]["grade__name"]), xinxi['retlist'][0]["id"],
            18273435112)
        ip.new_assert(self.add_student["retcode"], 0, "添加学生")
        self.student_id = self.add_student["id"]

    def tc002002_steup(self):
        pass

    def tc002002_teardown(self):
        print("""\n\n*** step1 *** 删除学生\n""")
        self.cc = ip.list_student()
        # 批量删除
        # for retlist_length in range(len(self.cc["retlist"])):
        # 	ip.delete_student(self.cc["retlist"][retlist_length]["id"])
        ip.delete_student(self.student_id)