def settree(): parentId = request.json['parent_id'] name = request.json['employee_name'] id = request.json['employee_id'] emp = Employee(id, name, parentId) return Employee.setitem(emp)
def getshortestpath(): src = int(request.args.get('emp1')) des = int(request.args.get('emp2')) list1 = Employee.getancestorpath(src) list2 = Employee.getancestorpath(des) shortpath = GraphUtil.shortestpath(list1, list2, src, des) return jsonify(shortpath)
def test_update_jobs_fleet_capacity(mocker): mocker.patch.object(Employee, 'getall') Employee.getall.return_value = 120 result = Employee.getall() print(result)
def getall(): return jsonify(Employee.getall())
def delnode(): id = request.args.get('emp') return Employee.delitem(id)
def getsubtree(): isjoindateflag = request.args.get('isjdflag') return jsonify(Employee.getsubtree(request.args.get('id'), isjoindateflag))
def gettree(): return jsonify(Employee.gettree(request.args.get('emp')))
def test_getall(self, client): result = Employee.getall() assert_result_is_dictionary(result, dict)
def test_getancestorpath(self, client): result = Employee.getancestorpath(DUMMY_ID) assert_result_is_dictionary(result, list)
def test_getsubtree_joiningdateflag_set(self, client): result = Employee.getsubtree(DUMMY_ID, True) assert_result_is_dictionary(result, dict)
def test_gettree(self, client): result = Employee.gettree(DUMMY_ID) assert_result_is_dictionary(result, dict)