예제 #1
0
class TestScg(TestCase):
    def setUp(self):
        # Load in the workbook
        excel = Excel('data/scg/test.xlsx')
        scg_id, scg_content, truth, req_at, resp_at = excel.get_scg_record(1)
        self.scg1 = Scg(scg_id, scg_content, truth, req_at, resp_at)  # x + y

        scg_id, scg_content, truth, req_at, resp_at = excel.get_scg_record(2)
        self.scg2 = Scg(scg_id, scg_content, truth, req_at, resp_at)  # x + y

    def test_save_image1(self):
        self.scg1.save_image('temp/' + str(self.scg1.id) + '.png')

    def test_get_latex1(self):
        latex = self.scg1.get_latex()
        print latex

    def test_save_image2(self):
        self.scg2.save_image('temp/' + str(self.scg2.id) + '.png')

    def test_get_latex2(self):
        latex = self.scg2.get_latex()
        print latex
        aspect = self.scg2.w_h_ratio
        print 'aspect ratio: ', aspect
        print 'request_at: ', self.scg2.request_at
예제 #2
0
    def test_bugfix_1509714111470(self):
        test_id = 1509714111470
        row = 21838
        id, content, truth = self.excel.get_scg_record(row)
        self.assertEquals(test_id, id)

        scg = Scg(id, content, truth)
        scg.save_image('temp/' + str(id) + '.png')
예제 #3
0
    def test_bugfix_1509259382091(self):
        test_id = 1509259382091
        row = 12312
        id, content, truth = self.excel.get_scg_record(row)
        self.assertEquals(test_id, id)

        scg = Scg(id, content, truth)
        scg.save_image('temp/' + str(id) + '.png')