コード例 #1
0
 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)
コード例 #2
0
 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)
コード例 #3
0
 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)
コード例 #4
0
 def test_explain(self, formula, f_list):
     self.assertEquals(DiapasonFormula.explain(formula), f_list)
コード例 #5
0
 def test_is_formula(self, formula, result):
     self.assertEquals(DiapasonFormula.is_formula(formula), result)