def test_get_tag(self): this_config = ta2_config.Ta2Config() this_config.performername = "white knight" this_config.results_db_path = ":memory:" this_report_generator = t2rg.Ta2ReportGenerator(jinja_env=None, config=this_config) this_section = ta2_section.Ta2Section( jinja_template=None, report_generator=this_report_generator) self.assertEqual( this_section.get_tag(aux="silly section tagging"), "Ta2Section_sillysectiontagging")
def test_get_base_correct_keygen_constraint_list(self): conf = t2c.Ta2Config() conf.performername = "PERF" conf.baselinename = "MIT" fields = [(t2s.PERKEYGEN_TABLENAME, t2s.PERKEYGEN_LATENCY)] expected_base_correct_constraint_list = [ (t2s.PERKEYGEN_TABLENAME, t2s.PERKEYGEN_PERFORMERNAME, conf.baselinename) ] actual_base_correct_constraint_list = conf.get_constraint_list( fields=fields, require_correct=True, usebaseline=True) self.assertEquals(expected_base_correct_constraint_list, actual_base_correct_constraint_list)
def test_get_perf_correct_eval_constraint_list(self): conf = t2c.Ta2Config() conf.performername = "PERF" conf.baselinename = "MIT" fields = [(t2s.PEREVALUATION_TABLENAME, t2s.PEREVALUATION_EVALUATIONLATENCY)] expected_perf_correct_constraint_list = [ (t2s.PEREVALUATION_TABLENAME, t2s.PEREVALUATION_CORRECTNESS, True), (t2s.PEREVALUATION_TABLENAME, t2s.PEREVALUATION_PERFORMERNAME, conf.performername) ] actual_perf_correct_constraint_list = conf.get_constraint_list( fields=fields, require_correct=True, usebaseline=False) self.assertEquals(expected_perf_correct_constraint_list, actual_perf_correct_constraint_list)
# ---- ---- ------------ # 04 Nov 2013 SY Original version # ***************************************************************** # general imports: import sys import os import logging # SPAR imports: import spar_python.report_generation.ta2.ta2_database as t2d import spar_python.report_generation.ta2.ta2_schema as t2s import spar_python.report_generation.common.regression as regression import spar_python.report_generation.ta2.ta2_config as config config = config.Ta2Config() ################# CONFIGURE THESE PARAMETERS ONLY FOR EACH TEST ################ config.results_db_path = "../circuit_generation/ibm/phase2_tests/resultsdb.db" # the path to the results database config.img_dir = "./figures" # the path to the directory where created figures # are to be stored. # be sure to create new image directory # if you do not want to override previous images. config.performername = "BASE" # the name of the performer config.performerprototype = "Baseline" # the name of the performer # prototype config.baselinename = "BASE" # the name of the baseline # key generation latency: def keygenlatencyfunc(inputs, a, b, c, d):
def test_results_db(self): conf = t2c.Ta2Config() conf.results_db_path = ":memory:" self.assertEquals(type(conf.results_db), t2d.Ta2ResultsDB)