示例#1
0
def bundle_view(key=None):
    if not key:
        return render_template('404.html', e='Bundle not found.'), 404
    ds = Datastore()
    cwr_result = ds.get_one({'_id': key})
    if not cwr_result:
        return render_template('404.html', e='Bundle not found.'), 404
    bundle = Bundle(cwr_result)
    svg_path = bundle.svg_path()
    bundle_name = bundle.name
    results = bundle.test_result()
    history = None
    chart_data = bundle.generate_chart_data()
    return render_template(
        'bundle.html', bundle_name=bundle_name, results=results,
        svg_path=svg_path, history=history, chart_data=chart_data)
示例#2
0
def result_by_test_id(key=None):
    if not key:
        return render_template('404.html', e='Bundle not found.'), 404
    test_id = {}
    test_id['_id'] = key
    cwr_result = get_results_by_test_id(test_id)
    if not cwr_result:
        return render_template('404.html', e='Bundle not found.'), 404
    bundle = Bundle(cwr_result[0])
    for result in cwr_result:
        bundle.add_test_result(result)
    svg_path = bundle.svg_path()
    bundle_name = bundle.name
    results = bundle.test_result()
    history = None
    chart_data = bundle.generate_chart_data()
    return render_template(
        'bundle.html', bundle_name=bundle_name, results=results,
        svg_path=svg_path, history=history, chart_data=chart_data)
示例#3
0
 def test_svg_path_none(self):
     doc = make_doc()
     bundle = Bundle(bundle=doc)
     svg_path = bundle.svg_path()
     self.assertEqual(svg_path, 'No Image')
示例#4
0
 def test_svg_path(self):
     doc = make_doc()
     doc['svg_path'] = 'foo.svg'
     bundle = Bundle(bundle=doc)
     svg_path = bundle.svg_path()
     self.assertEqual(svg_path, 'http://data.vapour.ws/cwr/foo.svg')
示例#5
0
 def test_svg_path_none(self):
     doc = make_doc()
     bundle = Bundle(bundle=doc)
     svg_path = bundle.svg_path()
     self.assertEqual(svg_path, 'No Image')
示例#6
0
 def test_svg_path(self):
     doc = make_doc()
     doc['svg_path'] = 'foo.svg'
     bundle = Bundle(bundle=doc)
     svg_path = bundle.svg_path()
     self.assertEqual(svg_path, 'http://data.vapour.ws/cwr/foo.svg')