コード例 #1
0
 def test_non_dtm(self):
     score = MagicMock()
     score.mate = None
     score.cp = 100
     info_handler = MagicMock()
     info_handler.info = {'score': [None, score]}
     self.assertEqual(annotator.eval_human(True, info_handler), "1.00")
     self.assertEqual(annotator.eval_human(False, info_handler), "-1.00")
コード例 #2
0
 def test_negative_dtm(self):
     score = MagicMock()
     score.mate = -5
     score.cp = None
     info_handler = MagicMock()
     info_handler.info = {'score': [None, score]}
     self.assertEqual(annotator.eval_human(True, info_handler), "Mate in 5")
     self.assertEqual(annotator.eval_human(False, info_handler),
                      "Mate in 5")