Ejemplo n.º 1
0
    def testTemplateStringsAre9FormatStrings(self):
        template_list = _get_fact_template()
        FORMAT = ["TEST" for _ in range(10)]

        try:
            assert template_list[0].format(*FORMAT)
        except IndexError:
            assert False, "Failed test because of template mismatch"
Ejemplo n.º 2
0
 def testTemplateStringsFromFile(self):
     template_one_file = _get_fact_template(["f1_templates_001.temp"])
     assert template_one_file == [
         "{0} is next to the {4} programmer",
         "The person who uses {8} programs in {5}",
         "The {4} programmer uses {7}",
         "The {3} programmer isn't next to the {5} programmer",
         "{2} uses {8}",
     ]
Ejemplo n.º 3
0
 def testReturnTemplatesAsList(self):
     template_list = _get_fact_template()
     assert isinstance(template_list, list)
Ejemplo n.º 4
0
 def testNoEmptyStrings(self):
     template_list = _get_fact_template()
     assert all([len(clue) for file in template_list for clue in file])
Ejemplo n.º 5
0
 def testTemplateInnerListContainsStrings(self):
     template_list = _get_fact_template()
     assert isinstance(template_list[0][0], str)
Ejemplo n.º 6
0
 def testTemplateListContainsListOfStrings(self):
     template_list = _get_fact_template()
     assert all([isinstance(x, str) for x in template_list])
Ejemplo n.º 7
0
 def testReturnNonEmptyTemplatesList(self):
     template_list = _get_fact_template()
     assert len(template_list)