Example #1
0
def test_case2(app_url):
    restcli.base_url = urljoin(app_url, '/tests/')

    page = DPage(start=2, limit=4, sortable='+sn,-line')
    data = restcli.get('case2/', page=page)
    content_range = restcli.response.headers.get('Content-Range', None)
    assert content_range
    start, limit, total, sortable = parse_header_range(content_range)
    assert start == 3 and limit == 5 and sortable == '+sn,-line'
Example #2
0
def test_case2(app_url):
    restcli.base_url = urljoin(app_url, '/tests/')

    page = DPage(start=2, limit=4, sortable='+sn,-line')
    data = restcli.get('case2/', page=page)
    content_range = restcli.response.headers.get('Content-Range', None)
    assert content_range
    start, limit, total, sortable = parse_header_range(content_range)
    assert start == 3 and limit == 5 and sortable == '+sn,-line'
Example #3
0
def test_hi(app_url):
    restcli.base_url = urljoin(app_url, '/api-test/v1/sys/')

    data = [{'sn': 1021, 'name': 'test-a'}]
    data = restcli.get('abc/%d/abc/ds' % 1001,
                       qs_args=dict(name='testd',
                                    val=12.34,
                                    d1='2014-12-31T09:43:23'),
                       json_args=data)

    print(data)
Example #4
0
def test_case1(app_url):
    restcli.base_url = urljoin(app_url, '/tests/')

    data = restcli.get('case1/',
                        qs_args=dict(range='0-24@+sn,-date'))
Example #5
0
def test_case1(app_url):
    restcli.base_url = urljoin(app_url, '/tests/')

    data = restcli.get('case1/', qs_args=dict(range='0-24@+sn,-date'))