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()))
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()))
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()))
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)