def test_GetDataFromLogProcessor_OneGraphMultipleLines(self): log_processor = FakeLogProcessor({ 'graph-summary.dat': [ '{"traces": {"x": [1, 0]}, "rev": 123}', '{"traces": {"y": [1, 0]}, "rev": 123}', ] }) # We always expect the length of the lines list for each graph to be 1. # If it doesn't meet this expectation, ignore that graph. self.assertEqual({}, runtest._GetDataFromLogProcessor(log_processor))
def test_GetDataFromLogProcessor_BasicCase(self): """Tests getting of result data from a LogProcessor object.""" log_processor = FakeLogProcessor({ 'graphs.dat': ['[{"name": "my_graph"}]'], 'my_graph-summary.dat': ['{"traces": {"x": [1, 0]}, "rev": 123}'], }) # Note that the 'graphs.dat' entry is ignored. self.assertEqual( {'my_graph': {'traces': {'x': [1, 0]}, 'rev': 123}}, runtest._GetDataFromLogProcessor(log_processor))
def test_GetDataFromLogProcessor_InvalidJson(self): log_processor = FakeLogProcessor( {'graph-summary.dat': ['this string is not valid json']}) self.assertEqual({}, runtest._GetDataFromLogProcessor(log_processor))
def test_GetDataFromLogProcessor_InvalidJson(self): log_processor = FakeLogProcessor({ 'graph-summary.dat': ['this string is not valid json'] }) self.assertEqual({}, runtest._GetDataFromLogProcessor(log_processor))