Ejemplo n.º 1
0
 def testPie(self):
     pieChart = Pie('Participant Origin', self.pieData)
     html = ChartMaker.makeWebPage(pieChart)
     #print(html)
     htmlNoCR = re.sub('\n','',html)
     htmlMinimized = html_minify(htmlNoCR)
     #print(htmlMinimized)
     with open('data/testPieGroundTruth.txt', 'r') as fd:
         groundTruth = fd.read()
     self.assertEqual(self.removeLocalPart(groundTruth.strip()), self.removeLocalPart(htmlMinimized.strip()))
Ejemplo n.º 2
0
 def testLine(self):
     lineChart = Line('Percent Finishing to Certificate', self.xAxisLabels, 'Completion (%)', self.lineData)
     html = ChartMaker.makeWebPage(lineChart)
     #print(html)
     htmlNoCR = re.sub('\n','',html)
     htmlMinimized = html_minify(htmlNoCR)
     print(htmlMinimized)
     with open('data/testLineGroundTruth.txt', 'r') as fd:
         groundTruth = fd.read()
     self.assertEqual(self.removeLocalPart(groundTruth.strip()), self.removeLocalPart(htmlMinimized.strip()))
Ejemplo n.º 3
0
 def testHistogram(self):
     histChart = Histogram('Testchart', 
                           'Correctness',
                           ['correct', 'incorrect'],
                           self.histogramData)
     html = ChartMaker.makeWebPage(histChart)
     #print(html)
     htmlNoCR = re.sub('\n','',html)
     htmlMinimized = html_minify(htmlNoCR)
     #print(htmlMinimized)
     with open('data/testHistogramGroundTruth.txt', 'r') as fd:
         groundTruth = fd.read()
     self.assertEqual(self.removeLocalPart(groundTruth.strip()), self.removeLocalPart(htmlMinimized.strip()))
Ejemplo n.º 4
0
 def testHeatmap(self):
     #heatChart = Heatmap('data/testHeatmapInput.csv',
     heatChart = Heatmap('data/videoByWeekCS145.csv',
                         chartTitle='Test Heatmap',
                         chartSubtitle='Test subtitle',
                         yLabelSuffix=':00',
                         colorAxisLabelSuffix='C',
                         rowsToSkip=1,
                         )
     html = ChartMaker.makeWebPage(heatChart)
     #print(html)
     with open('/home/paepcke/tmp/trash9.html', 'w') as fd:
         for line in html:
             fd.write(line)