Example #1
0
def test_get_contacts():
    client, check_assertions = check_client_method()
    result = client.Contact.get_contacts()
    check_assertions(result, 'GET', '/contact/')

    client, check_assertions = check_client_method()
    result = client.Contact.get_contacts(limit=100)
    check_assertions(result, 'GET', '/contact/?limit=100')
Example #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)
Example #3
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)
Example #4
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'})
Example #5
0
def test_find_by_app_item_id():
    app_id = 1
    item_id = 2

    client, check_assertions = check_client_method()
    result = client.Item.find_by_app_item_id(app_id, item_id)
    check_assertions(result, 'GET', '/app/%d/item/%d' % (app_id, item_id))
Example #6
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))
def test_find_by_org_space_and_app_labels():
	org_label = 'travelplanet24com'
	space_label = 'rnd-team'
	app_label = 'stories'

	client, check_assertions = check_client_method()
	result = client.Application.find_by_org_space_and_app_labels(org_label, space_label, app_label)
	check_assertions(result, 'GET', '/app/org/%s/space/%s/%s' % (org_label, space_label, app_label))
Example #8
0
def test_get_view():
    app_id = 122
    view_id = 222
    view_name = 'pizzas4life'

    client, check_assertions = check_client_method()
    result = client.View.get(app_id, view_id)
    check_assertions(result, 'GET', '/view/app/{}/{}'.format(app_id, view_id))

    client, check_assertions = check_client_method()
    result = client.View.get(app_id, view_name)
    check_assertions(result, 'GET',
                     '/view/app/{}/{}'.format(app_id, view_name))

    client, check_assertions = check_client_method()
    result = client.View.get(app_id, 'last')
    check_assertions(result, 'GET', '/view/app/{}/{}'.format(app_id, 'last'))
Example #9
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))
Example #10
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)
Example #11
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)
Example #12
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))
Example #13
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))
Example #14
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'})
Example #15
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))
Example #16
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))
Example #17
0
def test_create():
    app_id = 12345
    view_details = {}

    client, check_assertions = check_client_method()
    result = client.View.create(app_id, view_details)
    check_assertions(result, 'POST', '/view/app/{}/'.format(app_id),
                     json.dumps(view_details),
                     {'content-type': 'application/json'})
Example #18
0
def test_update_last_view():
    app_id = 666777888
    attributes = {'a': 'b', 'c': 'd'}
    client, check_assertions = check_client_method()
    result = client.View.update_last_view(app_id, attributes)
    check_assertions(result,
                     'PUT',
                     '/view/app/{}/last'.format(app_id),
                     expected_body=json.dumps(attributes),
                     expected_headers={'content-type': 'application/json'})
Example #19
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))
Example #20
0
def test_update_view():
    view_id = 131314
    attributes = {'a': 'b', 'c': 'd'}
    client, check_assertions = check_client_method()
    result = client.View.update_view(view_id, attributes)
    check_assertions(result,
                     'PUT',
                     '/view/{}'.format(view_id),
                     expected_body=json.dumps(attributes),
                     expected_headers={'content-type': 'application/json'})
Example #21
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'})
Example #22
0
def test_make_default():

    view_id = 8675309
    client, check_assertions = check_client_method()
    result = client.View.make_default(view_id)
    check_assertions(result,
                     'POST',
                     '/view/{}/default'.format(view_id),
                     expected_body=json.dumps({}),
                     expected_headers={'content-type': 'application/json'})
Example #23
0
def test_filter_by_view():
    app_id = 421
    view_id = 123

    client, check_assertions = check_client_method()
    result = client.Item.filter_by_view(app_id, view_id)
    check_assertions(result,
                     'POST',
                     '/item/app/{}/filter/{}'.format(app_id, view_id),
                     expected_body=json.dumps({}),
                     expected_headers={'content-type': 'application/json'})
Example #24
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'})
Example #25
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'})
Example #26
0
def test_get_views():

    app_id = 12346789
    client, check_assertions = check_client_method()
    result = client.View.get_views(app_id)
    check_assertions(
        result, 'GET',
        '/view/app/{}/?include_standard_views=false'.format(app_id))

    client, check_assertions = check_client_method()
    result = client.View.get_views(app_id, True)
    check_assertions(
        result, 'GET',
        '/view/app/{}/?include_standard_views=true'.format(app_id))

    client, check_assertions = check_client_method()
    result = client.View.get_views(app_id, False)
    check_assertions(
        result, 'GET',
        '/view/app/{}/?include_standard_views=false'.format(app_id))
Example #27
0
def test_filter_by_view():
    app_id = 421
    view_id = 123

    client, check_assertions = check_client_method()
    result = client.Item.filter_by_view(app_id, view_id)
    check_assertions(result,
                     'POST',
                     '/item/app/{}/filter/{}'.format(app_id, view_id),
                     expected_body=json.dumps({}),
                     expected_headers={'content-type': 'application/json'})
Example #28
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'})
Example #29
0
def test_create():

	commentable_type = 'item'
	commentable_id = 1

	attributes = {'value': '[rnd/bugs-1]', 'external-id' : '045e620f7be09630a16288a145a3e54d0c9a254b'}

	client, check_assertions = check_client_method()
	result = client.Comment.create(commentable_type, commentable_id, attributes)
	check_assertions(result,
					'POST',
					'/comment/%s/%d' % (commentable_type, commentable_id),
					json.dumps(attributes),
					{'content-type': 'application/json'})
Example #30
0
def test_delete():
    view_id = 67423

    client, check_assertions = check_client_method()
    result = client.View.delete(view_id)
    check_assertions(result, 'DELETE', '/view/{}'.format(view_id))
Example #31
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)
Example #32
0
def test_values_v2():
    item_id = 9271

    client, check_assertions = check_client_method()
    result = client.Item.values_v2(item_id)
    check_assertions(result, 'GET', '/item/%s/value/v2' % item_id)
Example #33
0
def test_item_revision_difference():
    item_id = 2
    from_id = 4
    to_id = 8

    client, check_assertions = check_client_method()
Example #34
0
def test_find_all_personal():
    client, check_assertions = check_client_method()
    result = client.Stream.find_all_personal()
    check_assertions(result, 'GET', '/stream/personal/')
Example #35
0
def test_find_all_personal():
    client, check_assertions = check_client_method()
    result = client.Stream.find_all_personal()
    check_assertions(result, 'GET', '/stream/personal/')
Example #36
0
def test_item_revision_difference():
    item_id = 2
    from_id = 4
    to_id = 8

    client, check_assertions = check_client_method()
Example #37
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)
Example #38
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))
Example #39
0
def test_values_v2():
    item_id = 9271

    client, check_assertions = check_client_method()
    result = client.Item.values_v2(item_id)
    check_assertions(result, 'GET', '/item/%s/value/v2' % item_id)
Example #40
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)
Example #41
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)
Example #42
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)
Example #43
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)