def test_executions_singleRow(self) : data = [ ("20130301-010101", "param1", 4), ] w = ClientStatsPlot() result = w.executions(data) self.assertEqual(result, [ "20130301-010101", ])
def test_executions_repeatedExecution(self) : data = [ ("20130301-010101", "param1", 4), ("20130301-010101", "param1", 5), ] w = ClientStatsPlot() result = w.executions(data) self.assertEqual(result, [ "20130301-010101", ])
def test_keys_repeatedParam(self) : data = [ ("20130301-010101", "param1", 4), ("20130301-010101", "param1", 4), ] w = ClientStatsPlot() result = w.keys(data) self.assertEqual(result, [ "param1", ])
def test_tuplesToJson_emptyData(self) : data = [ ] w = ClientStatsPlot() result = w.tuplesToJson(data) self.assertMultiLineEqual(result, "[\n" "[ 'Execution' ],\n" "]\n" )
def test_tuplesToJson_repeatedExecutionParamLastRemains(self) : data = [ ("20130301-010101", "param1", 4), ("20130301-010101", "param1", 5), ] w = ClientStatsPlot() result = w.tuplesToJson(data) self.assertMultiLineEqual(result, "[\n" "[ 'Execution', 'param1' ],\n" "[ '20130301-010101', 5 ],\n" "]\n" )
def test_tuplesToJson_singleRow(self) : data = [ ("20130301-010101", "param1", 4), ] w = ClientStatsPlot() result = w.tuplesToJson(data) self.assertMultiLineEqual(result, "[\n" "[ 'Execution', 'param1' ],\n" "[ '20130301-010101', 4 ],\n" "]\n" )
def test_tuplesToJson_twoExecutionsSameParam(self) : data = [ ("20130301-010101", "param1", 4), ("20130301-020202", "param1", 5), ] w = ClientStatsPlot() result = w.tuplesToJson(data) self.assertMultiLineEqual(result, "[\n" "[ 'Execution', 'param1' ],\n" "[ '20130301-010101', 4 ],\n" "[ '20130301-020202', 5 ],\n" "]\n" )
def test_tuplesToJson_missingParamIsNull(self) : data = [ ("20130301-010101", "param1", 4), ("20130301-010101", "param2", 5), ("20130301-020202", "param2", 7), ] w = ClientStatsPlot() result = w.tuplesToJson(data) self.assertMultiLineEqual(result, "[\n" "[ 'Execution', 'param1', 'param2' ],\n" "[ '20130301-010101', 4, 5 ],\n" "[ '20130301-020202', null, 7 ],\n" "]\n" )
def test_tuplesToJson_emptyData(self) : data = [ ("20130301-010101", "param1", 4), ("20130301-010101", "param2", 6), ("20130301-010101", "param1", 1), ("20130301-010101", "param2", 2), ("20130301-020202", "param1", 2), ("20130301-020202", "param2", 3), ] w = ClientStatsPlot() result = w.tuplesToJson([]) self.assertMultiLineEqual(result, "[\n" "]\n" )