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)
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'})
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))
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)
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))
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))
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)
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))
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))
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'})
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'})
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)
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)
def test_item_revision_difference(): item_id = 2 from_id = 4 to_id = 8 client, check_assertions = check_client_method()
def test_find_all_personal(): client, check_assertions = check_client_method() result = client.Stream.find_all_personal() check_assertions(result, 'GET', '/stream/personal/')