# Path: ckan_api_client/tests/utils/strings.py
# def gen_random_id(length=10):
#     """Generate a random id, made of lowercase ascii letters + digits"""
#     charset = string.ascii_lowercase + string.digits
#     return ''.join(random.choice(charset) for _ in xrange(length))
# 
# def gen_picture(s, size=200):
#     """Generate URL to picture from some text hash"""
#     return gen_robohash(s, size)


import json
import random
import string
    import os
    import sys
from .strings import gen_random_id, gen_picture
    """
    Generate a random organization object, with:

    - ``name``, random, example: ``"org-abc123"``
    - ``title``, random, example: ``"Organization abc123"``
    - ``description``, random
    - ``image``, url pointing to a random-generated pic
    """

    random_id = gen_random_id(10)
    return {
        "name": "org-{0}".format(random_id),  # Used as key
        "title": "Organization {0}".format(random_id),
        "description": "Description of organization {0}".format(random_id),
        "image_url": gen_picture(random_id),
        # "extras": [],
        # "tags": [],
    }


def generate_group():
    """
    Generate a random group object, with:

    - ``name``, random, example: ``"grp-abc123"``
    - ``title``, random, example: ``"Group abc123"``
    - ``description``, random
    - ``image``, url pointing to a random-generated pic
    """


# Path: ckan_api_client/tests/utils/strings.py
# def gen_random_id(length=10):
#     """Generate a random id, made of lowercase ascii letters + digits"""
#     charset = string.ascii_lowercase + string.digits
#     return ''.join(random.choice(charset) for _ in xrange(length))
# 
# def gen_picture(s, size=200):
#     """Generate URL to picture from some text hash"""
#     return gen_robohash(s, size)


# Path: ckan_api_client/tests/utils/generate.py
import json
import random
import string
    import os
    import sys
from .strings import gen_random_id, gen_picture

    """
    Generate a random organization object, with:

    - ``name``, random, example: ``"org-abc123"``
    - ``title``, random, example: ``"Organization abc123"``
    - ``description``, random
    - ``image``, url pointing to a random-generated pic
    """

    random_id = gen_random_id(10)
    return {
        "name": "org-{0}".format(random_id),  # Used as key
        "title": "Organization {0}".format(random_id),
        "description": "Description of organization {0}".format(random_id),
        "image_url": gen_picture(random_id),
        # "extras": [],
        # "tags": [],
    }


def generate_group():
    """
    Generate a random group object, with:

    - ``name``, random, example: ``"grp-abc123"``
    - ``title``, random, example: ``"Group abc123"``
    - ``description``, random
    - ``image``, url pointing to a random-generated pic
    """


    random_id = gen_random_id(10)