def test_dep_lists_id_not_exist(self): dept_management = DeptManagement() id = (Read_File_Yaml('../testdata/delete_dep.yaml') ).get('dep_id4').get("id") dept_management.get_dep_lists(id) dep_lists = dept_management.get_response() assert len(dep_lists.get('department')) == 0
def test_dep_lists_no_id(self): dept_management = DeptManagement() dept_management.get_dep_lists() dep_lists = dept_management.get_response() assert len(dep_lists.get('department')) > 0
def test_create_exist_dep(self): dept_management = DeptManagement() dept_management.create_dept("dep2") create_res = dept_management.get_response() assert create_res.get('errcode') == 60008
def test_create_dep_name_null(self): dept_management = DeptManagement() dept_management.create_dept("dep3") create_res = dept_management.get_response() assert create_res.get('errcode') == 60001
def test_create_new_dep(self): dept_management = DeptManagement() dept_management.create_dept_nameRandom("dep1") create_res = dept_management.get_response() assert create_res.get('errmsg') == 'created'