def test_b_add(self): r = add(self.bangumi_name_1, 0) assert r["status"] == "success", r["message"] r = add(self.bangumi_name_1, 0) assert r["status"] == "warning", r["message"] r = delete(self.bangumi_name_1) assert r["status"] == "warning", r["message"]
def test_c_mark(self): add(self.bangumi_name_1, 0) r = mark(self.bangumi_name_1, 1) assert r["status"] == "success", r["message"] r = mark(self.bangumi_name_1, None) assert r["status"] == "info", r["message"] r = mark(self.bangumi_name_2, 0) assert r["status"] == "error", r["message"]
def add_wrapper(ret): for bangumi_name in ret.name: result = add(name=bangumi_name, episode=ret.episode) globals()["print_{}".format(result['status'])](result['message'])
def add_wrapper(ret: Any) -> None: for bangumi_name in ret.name: result = add(name=bangumi_name, episode=ret.episode) globals()["print_{}".format(result["status"])](result["message"])