示例#1
0
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, 'Не смог найти созданную накладную'
示例#2
0
def test_19():
    token = authorisation()

    id_ = 'ad9204fb-4007-4185-9288-503e55f66f0c'

    r = get_by_id(token, id_)

    assert r['result'] is not None, 'Система не нашла объект'
示例#3
0
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'
示例#4
0
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_$'
示例#5
0
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_$'
示例#6
0
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', 'Попал в другой блок'
示例#7
0
def test_13():
    token = authorisation()

    destinationPointId = Pathes.destinationPointId_1202

    r = included_in_consolidation(token, destinationPointId)

    destinationPoint = r['result']['destinationPoint']

    assert destinationPoint['code'] == '1202', 'Попал в другой блок'
示例#8
0
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»'
示例#10
0
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, 'Группа не удалилась'
示例#11
0
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'] == "Отсутствует введенное место накладной", 'Система не вернула ошибку «Отсутствует введенное место накладной»'
示例#12
0
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, 'Накладная не была удалена'
示例#13
0
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()
示例#15
0
def test_3():
    r = authorisation(wrong=True)

    assert r.status_code != 200, 'Логин и пароль оказались верны'
示例#16
0
def test_1():
    authorisation()
示例#17
0
def test_5():
    token = authorisation()

    r = get_all_groups(token)

    assert r['result'] != None, 'Не смог найти группы'