コード例 #1
0
def test_():
    with allure.step('step 0: '):
        tok = f.get_token()
        assert tok != -1, 'get_token fail'

    with allure.step('step 1: '):
        r = f.create_event_blocks_71(tok)
        assert r.status_code == 200, 'create_event_blocks_71 fail'

    with allure.step('step 2: '):
        r = json.loads(r.text)
        block_number = r['result']['number']
        assert block_number[0:3] == 'MOW', 'invalid block_id'

    with allure.step('step 3'):
        block_id = r['result']['id']
        r = f.create_event_blocks_71_object(tok, block_id, pth.incorrect_71_block_num_1)
        assert r.status_code == 200, 'create_event_blocks_71_object fail'

    with allure.step('step 4: '):
        r = json.loads(r.text)
        object_ok = r['ok']
        fail_message = r['metadata']['message']
        assert not object_ok and \
               fail_message == f'Номер объекта не валидный: {pth.incorrect_71_block_num_1}', 'object not created'
コード例 #2
0
def test_():
    with allure.step('step 0: '):
        tok = f.get_token()
        assert tok != -1, 'get_token fail'

    with allure.step('step 1: '):
        r = f.create_event_blocks_71(tok)
        assert r.status_code == 200, 'create_event_blocks_71 fail'

    with allure.step('step 2: '):
        r = json.loads(r.text)
        block_number = r['result']['number']
        assert block_number[0:3] == 'MOW', 'invalid block_id'

    with allure.step('step 3'):
        block_id = r['result']['id']
        r = f.create_event_blocks_71_object(tok, block_id,
                                            pth.correct_71_block_num)
        assert r.status_code == 200, 'create_event_blocks_71_object fail'

    with allure.step('step 4: '):
        r = json.loads(r.text)
        post_ok = r['ok']
        assert post_ok, 'object not created'

    with allure.step('step 5'):
        object_id = r['result']['id']
        r = f.get_event_blocks_71_object(tok, block_id, object_id)
        assert r.status_code == 200, 'get_event_blocks_71_object fail'

    with allure.step('step 6: '):
        r = json.loads(r.text)
        find_ok = r['ok']
        assert find_ok, 'object not found'
コード例 #3
0
def test_():
    with allure.step('step 0: '):
        tok = f.get_token()
        assert tok != -1, 'get_token fail'

    with allure.step('step 1: '):
        assert not f.check_group_existence(
            tok, pth.random_name), 'group already exists'

    with allure.step('step 2: '):
        r = f.create_group(tok, pth.random_name)
        assert r.status_code == 200, 'create_group fail'

    with allure.step('step 3: '):
        assert f.check_group_existence(tok,
                                       pth.random_name), 'group not created'

    with allure.step('step 4: '):
        group_id = f.check_group_existence(tok, pth.random_name)
        r = f.delete_group(tok, group_id)
        assert r.status_code == 200, 'delete_group fail'

    with allure.step('step 5: '):
        assert not f.check_group_existence(
            tok, pth.random_name), 'group not deleted'
コード例 #4
0
def test_():
    with allure.step('step 0: '):
        tok = f.get_token()
        assert tok != -1, 'get_token fail'

    with allure.step('step 1: '):
        r = f.get_address_by_id(tok, pth.correct_adress_id)
        r = json.loads(r.text)
        ok = r['ok']
        fail_message = r['metadata']
        assert ok and fail_message is None, 'wrong address id'
コード例 #5
0
def test_():
    with allure.step('step 0: '):
        tok = f.get_token()
        assert tok != -1, 'get_token fail'

    with allure.step('step 1: '):
        r = f.get_polygon_by_address_id(tok, pth.incorrect_adress_id)
        r = json.loads(r.text)
        ok = r['ok']
        fail_message = r['metadata']['message']
        assert not ok and \
               fail_message == f'$_ADDRESS_NOT_FOUND_$ addressId:{pth.incorrect_adress_id}', 'wrong address id'
コード例 #6
0
def test_():
    with allure.step('step 0: '):
        tok = f.get_token()
        assert tok != -1, 'get_token fail'

    with allure.step('step 1: '):
        r = f.create_event_blocks_79(tok, pth.destinationPointId_1202)
        assert r.status_code == 200, 'create_event_blocks_79 fail'

    with allure.step('step 2: '):
        r = json.loads(r.text)
        destination_point = r['result']['destinationPoint']['code']
        assert destination_point == '1202', 'invalid destinationPoint'
コード例 #7
0
def test_():
    with allure.step('step 0: '):
        tok = f.get_token()
        assert tok != -1, 'get_token fail'

    with allure.step('step 1: '):
        r = f.create_event_blocks_71(tok)
        assert r.status_code == 200, 'create_event_blocks_71 fail'

    with allure.step('step 2: '):
        r = json.loads(r.text)
        block_id = r['result']['number']
        assert block_id[0:3] == 'MOW', 'invalid block_id'
コード例 #8
0
def test_():
    with allure.step('step 0: '):
        tok = f.get_token()
        assert tok != -1, 'get_token fail'

    with allure.step('step 1: '):
        r = f.create_event_blocks_79(tok, pth.destinationPointId_1202)
        assert r.status_code == 200, 'create_event_blocks_79 fail'

    with allure.step('step 2: '):
        r = json.loads(r.text)
        block_id = r['result']['id']
        destination_point = r['result']['destinationPoint']['code']
        assert destination_point == '1202', 'invalid destinationPoint'

    with allure.step('step 3: '):
        r = f.create_event_blocks_79_object(tok, block_id,
                                            pth.incorrect_79_block_num)
        assert r.status_code == 200, 'create_event_blocks_79_object fail'

    with allure.step('step 4: '):
        r = json.loads(r.text)
        fail_message = r['metadata']['message']
        assert fail_message == 'Отсутствует введенное место накладной', 'object created'