def test_generatelist(self, formula, year, dates_list): formula_obj = DiapasonFormula(formula, year) try: formula_obj.generatelist() d_list = formula_obj.dates_list except FormulaException: d_list = False self.assertEquals(d_list, dates_list)
def test_check(self, date_list1, date_list2, correct): try: # просто левая формула formula_obj = DiapasonFormula("12.01~13.01") formula_obj.check(date_list1, date_list2) is_correct = True except FormulaException: is_correct = False self.assertEquals(is_correct, correct)
def test_diapason(self, date1, date2, dates_list): # просто левая формула formula_obj = DiapasonFormula("12.01~13.01") formula_obj.diapason([date1], [date2]) self.assertEquals(formula_obj.dates_list, dates_list)
def test_explain(self, formula, f_list): self.assertEquals(DiapasonFormula.explain(formula), f_list)
def test_is_formula(self, formula, result): self.assertEquals(DiapasonFormula.is_formula(formula), result)