Exemple #1
0
def post_collection_of_resources(context):
    """Iterate over a table where the first two columns are `type` and `name`.
  Successive columns are for properties to be set on the resource before
  posting it to the relevant collection.
  """
    for row in context.table:
        resource_type = row[0]
        name = row[1]
        properties = dict([(heading, row[heading]) for heading in row.headings[2:]])
        handle_named_example_resource(context, resource_type, name, **properties)
        handle_post_named_example(context, name)
        handle_get_example_resource(context, name)
Exemple #2
0
def post_collection_of_resources(context):
    """Iterate over a table where the first two columns are `type` and `name`.
  Successive columns are for properties to be set on the resource before
  posting it to the relevant collection.
  """
    for row in context.table:
        resource_type = row[0]
        name = row[1]
        properties = dict([(heading, row[heading])
                           for heading in row.headings[2:]])
        handle_named_example_resource(context, resource_type, name,
                                      **properties)
        handle_post_named_example(context, name)
        handle_get_example_resource(context, name)
Exemple #3
0
def get_example_resource(context, name, expected_status=200):
    handle_get_example_resource(context, name, expected_status)
def get_example_resource(context, name, expected_status=200):
  handle_get_example_resource(context, name, expected_status)