def _ReadGraphJsonValue(request): arguments = {} chart = request.get('chart') trace = request.get('trace') if not (chart or trace): return {}, None if chart and not trace: raise TypeError('"chart" specified but no "trace" given.') if trace and not chart: raise TypeError('"trace" specified but no "chart" given.') arguments['chart'] = chart arguments['trace'] = trace return arguments, quest_module.ReadGraphJsonValue(chart, trace)
def testAllArguments(self): arguments = { 'configuration': 'chromium-rel-mac11-pro', 'target': 'net_perftests', 'dimensions': '{"key": "value"}', 'chart': 'chart_name', 'trace': 'trace_name', } expected_quests = [ quest.FindIsolate('chromium-rel-mac11-pro', 'net_perftests'), quest.RunTest({'key': 'value'}, _MIN_GTEST_RUN_TEST_ARGUMENTS), quest.ReadGraphJsonValue('chart_name', 'trace_name'), ] self.assertEqual(quest_generator.GenerateQuests(arguments), (arguments, expected_quests))