Esempio n. 1
0
def test_find():
    item_id = 9271

    client, check_assertions = check_client_method()
    result = client.Item.find(item_id)
    check_assertions(result, 'GET', '/item/%s' % item_id)

    client, check_assertions = check_client_method()
    result = client.Item.find(item_id, basic=True)
    check_assertions(result, 'GET', '/item/%s/basic' % item_id)
Esempio n. 2
0
def test_find():
    item_id = 9271

    client, check_assertions = check_client_method()
    result = client.Item.find(item_id)
    check_assertions(result, 'GET', '/item/%s' % item_id)

    client, check_assertions = check_client_method()
    result = client.Item.find(item_id, basic=True)
    check_assertions(result, 'GET', '/item/%s/basic' % item_id)
Esempio n. 3
0
def test_update():
    app_id = 1
    attributes = {'1': 1, '2': 3, '5': '8'}

    client, check_assertions = check_client_method()
    result = client.Item.update(app_id, attributes)
    check_assertions(result, 'PUT', '/item/%s' % app_id,
                     json.dumps(attributes),
                     {'content-type': 'application/json'})

    client, check_assertions = check_client_method()
    result = client.Item.update(app_id, attributes, silent=True)
    check_assertions(result, 'PUT', '/item/%s?silent=true' % app_id,
                     json.dumps(attributes),
                     {'content-type': 'application/json'})
Esempio n. 4
0
def test_revisions():
    item_id = 255

    client, check_assertions = check_client_method()
    result = client.Item.revisions(item_id)
    check_assertions(result,
                     'GET',
                     '/item/%s/revision/' % (item_id))
Esempio n. 5
0
def test_next():
    item_id = 8071

    client, check_assertions = check_client_method()
    result = client.Item.next(item_id)
    check_assertions(result,
                     'GET',
                     '/item/%s/next' % item_id)
Esempio n. 6
0
def test_find_by_external_id():
    app_id = 13
    external_id = 37

    client, check_assertions = check_client_method()
    result = client.Item.find_all_by_external_id(app_id, external_id)
    check_assertions(result, 'GET',
                     '/item/app/%s/v2/?external_id=%s' % (app_id, external_id))
Esempio n. 7
0
def test_item_revisions():
    item_id = 255

    client, check_assertions = check_client_method()
    result = client.Item.revisions(item_id)
    check_assertions(result,
                     'GET',
                     '/item/%s/revision/' % (item_id))
Esempio n. 8
0
def test_prev():
    item_id = 4

    client, check_assertions = check_client_method()
    result = client.Item.prev(item_id)
    check_assertions(result,
                     'GET',
                     '/item/%s/previous' % item_id)
Esempio n. 9
0
def test_find_by_ref():
    # It's not entirely clear what inputs are appropriate for ref_type.
    # But for this test's purposes, any string will do.
    ref_type = 'item'
    ref_id = 10203

    client, check_assertions = check_client_method()
    result = client.Stream.find_by_ref(ref_type, ref_id)
    check_assertions(result, 'GET', '/stream/%s/%s' % (ref_type, ref_id))
Esempio n. 10
0
def test_revision_difference():
    item_id = 2
    from_id = 4
    to_id = 8

    client, check_assertions = check_client_method()
    result = client.Item.revision_difference(item_id, from_id, to_id)
    check_assertions(result, 'GET',
                     '/item/%s/revision/%s/%s' % (item_id, from_id, to_id))
Esempio n. 11
0
def test_find_by_external_id():
    app_id = 13
    external_id = 37

    client, check_assertions = check_client_method()
    result = client.Item.find_all_by_external_id(app_id, external_id)
    check_assertions(result,
                     'GET',
                     '/item/app/%s/v2/?external_id=%s' % (app_id, external_id))
Esempio n. 12
0
def test_update():
    app_id = 1
    attributes = {'1': 1, '2': 3, '5': '8'}

    client, check_assertions = check_client_method()
    result = client.Item.update(app_id, attributes)
    check_assertions(result,
                     'PUT',
                     '/item/%s' % app_id,
                     json.dumps(attributes),
                     {'content-type': 'application/json'})

    client, check_assertions = check_client_method()
    result = client.Item.update(app_id, attributes, silent=True)
    check_assertions(result,
                     'PUT',
                     '/item/%s?silent=true' % app_id,
                     json.dumps(attributes),
                     {'content-type': 'application/json'})
Esempio n. 13
0
def test_create():

    app_id = 1
    attributes = {'1': 1, '2': 3, '5': '8'}

    client, check_assertions = check_client_method()
    result = client.Item.create(app_id, attributes)
    check_assertions(result, 'POST', '/item/app/%s/' % app_id,
                     json.dumps(attributes),
                     {'content-type': 'application/json'})
Esempio n. 14
0
def test_revision_difference():
    item_id = 2
    from_id = 4
    to_id = 8

    client, check_assertions = check_client_method()
    result = client.Item.revision_difference(item_id, from_id, to_id)
    check_assertions(result,
                     'GET',
                     '/item/%s/revision/%s/%s' % (item_id, from_id, to_id))
Esempio n. 15
0
def test_filters():
    app_id = 426
    attributes = {'a': 1, 'zzzz': 12345}

    client, check_assertions = check_client_method()
    result = client.Item.filter(app_id, attributes)
    check_assertions(result,
                     'POST',
                     '/item/app/%s/filter/' % app_id,
                     expected_body=json.dumps(attributes),
                     expected_headers={'content-type': 'application/json'})
Esempio n. 16
0
def test_filters():
    app_id = 426
    attributes = {'a': 1, 'zzzz': 12345}

    client, check_assertions = check_client_method()
    result = client.Item.filter(app_id, attributes)
    check_assertions(result,
                     'POST',
                     '/item/app/%s/filter/' % app_id,
                     expected_body=json.dumps(attributes),
                     expected_headers={'content-type': 'application/json'})
Esempio n. 17
0
def test_create():

    app_id = 1
    attributes = {'1': 1, '2': 3, '5': '8'}

    client, check_assertions = check_client_method()
    result = client.Item.create(app_id, attributes)
    check_assertions(result,
                     'POST',
                     '/item/app/%s/' % app_id,
                     json.dumps(attributes),
                     {'content-type': 'application/json'})
Esempio n. 18
0
def test_find_all_by_org_id():
    org_id = 81076

    client, check_assertions = check_client_method()
    result = client.Stream.find_all_by_org_id(org_id)
    check_assertions(result, 'GET', '/stream/org/%s/' % org_id)
Esempio n. 19
0
def test_find_all_by_space_id():
    space_id = 2222

    client, check_assertions = check_client_method()
    result = client.Stream.find_all_by_space_id(space_id)
    check_assertions(result, 'GET', '/stream/space/%s/' % space_id)
Esempio n. 20
0
def test_item_revision_difference():
    item_id = 2
    from_id = 4
    to_id = 8

    client, check_assertions = check_client_method()
Esempio n. 21
0
def test_prev():
    item_id = 4

    client, check_assertions = check_client_method()
    result = client.Item.prev(item_id)
    check_assertions(result, 'GET', '/item/%s/previous' % item_id)
Esempio n. 22
0
def test_next():
    item_id = 8071

    client, check_assertions = check_client_method()
    result = client.Item.next(item_id)
    check_assertions(result, 'GET', '/item/%s/next' % item_id)
Esempio n. 23
0
def test_find_all_personal():
    client, check_assertions = check_client_method()
    result = client.Stream.find_all_personal()
    check_assertions(result, 'GET', '/stream/personal/')