~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/testing/factory.py

  • Committer: Tarmac
  • Author(s): Brad Crittenden
  • Date: 2013-08-01 20:59:27 UTC
  • mfrom: (325.1.9 bundle-search)
  • Revision ID: tarmac-20130801205927-lcbxxxb2bba92akt
[r=abentley][bug=][author=bac] Provide support for bundles in searching. The display of search results in the web app still only shows charms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
308
308
    return record_id, charm
309
309
 
310
310
 
311
 
def get_bundle_data(name='hoopy', owner='', basket=None, inherits=None,
 
311
def get_bundle_data(name=None, owner='', basket=None, inherits=None,
312
312
                    series='precise', title='', description='',
313
313
                    services=dict(), relations=dict(), promulgated=False,
314
314
                    branch_deleted=False):
 
315
    if name is None:
 
316
        name = random_string(10)
 
317
    if basket is None:
 
318
        basket = random_string(10)
315
319
    doctype = 'bundle'
316
320
    doctype  # Hush lint's dislike of defining variables for the vars() call.
317
321
    return dict(**vars())
322
326
    bundle = Bundle(bundle_data)
323
327
    bundle_data['_id'] = bundle.id
324
328
    db.bundles.insert(bundle_data)
325
 
    return bundle
 
329
    return bundle, bundle_data
326
330
 
327
331
 
328
332
def make_charm_file(db, charm, path, content=None):