def test_9(): token = authorisation() r = without_sorting_and_couriers(token) id_ = r['result']['id'] assert id_ != None, 'Блок не был создан' number = "11-1111-1111" r = add_object(token, id_, number) assert r['result'] != None, 'Не смог добавить накладную' waybill_id = r['result']['id'] r = find_object(token, id_) assert r['result'] != None, 'Не смог добавить найти добавленные накладные' for waybill in r['result']: if waybill['id'] == waybill_id: return assert 0, 'Не смог найти созданную накладную'
def test_19(): token = authorisation() id_ = 'ad9204fb-4007-4185-9288-503e55f66f0c' r = get_by_id(token, id_) assert r['result'] is not None, 'Система не нашла объект'
def test_16(): token = authorisation() id_ = '2344f4b3-a7bd-4512-686d-08d8c4533103' r = get_by_id(token, id_) assert r['metadata'][ 'message'] == 'Object not found', 'Система не вернула ошибку Object not found'
def test_17(): token = authorisation() id_ = '2344f4b3-a7bd-4512-686d-08d8c4533103' r = get_polygon_by_address_id(token, id_) assert '$_ADDRESS_NOT_FOUND_$' in r['metadata'][ 'message'], 'Система не вернула ошибку $_ADDRESS_NOT_FOUND_$'
def test_18(): token = authorisation() id_ = '2344f4b3-a7bd-4512-686d-08d8c4533103' number = '11-1111-1111' r = get_polygon_with_coordinates_by_address_id(token, id_, number) assert '$_ADDRESS_NOT_FOUND_$' in r['metadata'][ 'message'], 'Система не вернула ошибку $_ADDRESS_NOT_FOUND_$'
def test_13(): token = request_authorisation.authorisation() destinationPointId = paths_r.destinationPointId_1202 r = event_79.included_in_consolidation(token, destinationPointId) destinationPoint = r['result']['destinationPoint'] assert destinationPoint['code'] == '1202', 'Попал в другой блок'
def test_13(): token = authorisation() destinationPointId = Pathes.destinationPointId_1202 r = included_in_consolidation(token, destinationPointId) destinationPoint = r['result']['destinationPoint'] assert destinationPoint['code'] == '1202', 'Попал в другой блок'
def test_11(): token = authorisation() r = without_sorting_and_couriers(token) id_ = r['result']['id'] assert id_ != None, 'Блок не был создан' number = "0012345666" r = add_object(token, id_, number) assert r['metadata'][ 'message'] == "Марка не привязана", 'Система не вернула ошибку «Марка не привязана»'
def test_10(): token = request_authorisation.authorisation() r = event_71.without_sorting_and_couriers(token) id_ = r['result']['id'] assert id_ != None, 'Блок не был создан' number = "11-1111-1112" r = event_71.add_object(token, id_, number) assert r['metadata'][ 'message'] == "Номер объекта не валидный: 11-1111-1112", 'Система не вернула ошибку «Номер объекта не валидный: 11-1111-1112»'
def test_6(): token = authorisation() r = get_all_groups(token) assert r['result'] != None, 'Не смог найти группы' date = datetime.datetime.now() name = date.strftime('%Y.%d.%m,%H.%M.%S.test_groop_request') for group in r['result']: assert group[ 'displayName'] != name, 'Группа с именем: ' + name + ' уже существует' r = create_group(token, name) assert r['result'] != None, 'Не смог создать группу' id_ = r['result']['id'] r = get_all_groups(token) assert r['result'] != None, 'Не смог найти группы' exists = 0 for group in r['result']: if group['displayName'] == name and group['id'] == id_: exists = 1 assert exists, 'Не нашёл созданную группу' delete_group(token, id_) r = get_all_groups(token) assert r['result'] != None, 'Не смог найти группы' exists = 0 for group in r['result']: if group['displayName'] == name and group['id'] == id_: exists = 1 assert not exists, 'Группа не удалилась'
def test_14(): token = authorisation() destinationPointId = Pathes.destinationPointId_1202 r = included_in_consolidation(token, destinationPointId) destinationPoint = r['result']['destinationPoint'] assert destinationPoint['code'] == '1202', 'Попал в другой блок' id_ = r['result']['id'] number = "99-9999-9999/999" r = add_object(token, id_, number) assert r['metadata'][ 'message'] == "Отсутствует введенное место накладной", 'Система не вернула ошибку «Отсутствует введенное место накладной»'
def test_12(): token = authorisation() r = without_sorting_and_couriers(token) id_ = r['result']['id'] assert id_ != None, 'Блок не был создан' number = "11-1111-1111" r = add_object(token, id_, number) assert r[ 'result'] != None, 'Не смог добавить накладную с номером: ' + number waybill_id = r['result']['id'] r = find_object(token, id_) assert r['result'] != None, 'Не смог добавить найти добавленные накладные' find = 0 for waybill in r['result']: if waybill['id'] == waybill_id: find = 1 assert find, 'Не смог найти созданную накладную с номером' delete_object(token, waybill_id) r = find_object(token, id_) for waybill in r['result']: assert waybill['id'] == waybill_id, 'Накладная не была удалена'
def test_8(): token = request_authorisation.authorisation() r = event_71.without_sorting_and_couriers(token) assert r['result']['id'] != None, 'Блок не был создан'
def test_1(): request_authorisation.authorisation()
def test_3(): r = authorisation(wrong=True) assert r.status_code != 200, 'Логин и пароль оказались верны'
def test_1(): authorisation()
def test_5(): token = authorisation() r = get_all_groups(token) assert r['result'] != None, 'Не смог найти группы'