Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 3
0
def post_named_example_to_collection_endpoint(context,
                                              name,
                                              expected_status=201):
    context._response = handle_post_named_example(context, name,
                                                  expected_status)
Ejemplo n.º 4
0
def post_named_example_to_collection_endpoint(
    context, name, expected_status=201):
  handle_post_named_example( context, name, expected_status)