Exemplo n.º 1
0
 def test_intervals_4(self):
     reviewer = Reviewer(FakeCollection(4, 1))
     reviewer.init()
     self.assertEqual({
         'again': 'interval_1',
         'easy': 'interval_4',
         'good': 'interval_3',
         'hard': 'interval_2',
     },reviewer.intervals())
Exemplo n.º 2
0
 def test_buttons_case_3(self):
     reviewer = Reviewer(FakeCollection(4, 1))
     reviewer.init()
     self.assertEqual(['again', 'hard', 'good', 'easy'], reviewer.buttons())
Exemplo n.º 3
0
 def test_buttons(self):
     reviewer = Reviewer(FakeCollection(2, 1))
     reviewer.init()
     self.assertEqual(['again', 'good'], reviewer.buttons())
Exemplo n.º 4
0
 def test_answer_button_list_case_4(self):
     reviewer = Reviewer(FakeCollection(None, 1))
     reviewer.init()
     self.assertEqual(((1, 'Again'), (2, 'Good')), reviewer.answer_button_list())
Exemplo n.º 5
0
 def test_answer_button_list_case_3(self):
     reviewer = Reviewer(FakeCollection(4, 1))
     reviewer.init()
     self.assertEqual(((1, 'Again'), (2, 'Hard'), (3, 'Good'), (4, 'Easy')), reviewer.answer_button_list())
Exemplo n.º 6
0
 def test_remaining_none(self):
     reviewer = Reviewer(FakeCollection(None, 0))
     reviewer.init()
     self.assertEqual({'new': 1, 'now': None, 'learning': 2, 'to_review': 3}, reviewer.remaining())
Exemplo n.º 7
0
 def test_remaining_to_review(self):
     reviewer = Reviewer(FakeCollection(2, 2))
     reviewer.init()
     self.assertEqual({'new': 1, 'now': 'to_review', 'learning': 2, 'to_review': 3}, reviewer.remaining())
Exemplo n.º 8
0
 def test_get_question_some(self):
     reviewer = Reviewer(FakeCollection(3, 1))
     reviewer.init()
     self.assertEqual('fake question', reviewer.get_question())
Exemplo n.º 9
0
 def test_is_finished_true(self):
     reviewer = Reviewer(FakeCollection(None, 1))
     reviewer.init()
     self.assertEqual(True, reviewer.is_finished())
Exemplo n.º 10
0
 def test_is_finished_false(self):
     reviewer = Reviewer(FakeCollection(3, 1))
     reviewer.init()
     self.assertEqual(False, reviewer.is_finished())
Exemplo n.º 11
0
 def test_intervals_none(self):
     reviewer = Reviewer(FakeCollection(None, 1))
     reviewer.init()
     self.assertEqual({}, reviewer.intervals())
Exemplo n.º 12
0
 def test_intervals_2(self):
     reviewer = Reviewer(FakeCollection(2, 1))
     reviewer.init()
     self.assertEqual({'again': 'interval_1', 'good': 'interval_2'}, reviewer.intervals())
Exemplo n.º 13
0
 def test_get_question_none(self):
     reviewer = Reviewer(FakeCollection(None, 1))
     reviewer.init()
     self.assertEqual(None, reviewer.get_question())
Exemplo n.º 14
0
 def test_buttons_case_4(self):
     reviewer = Reviewer(FakeCollection(None, 1))
     reviewer.init()
     self.assertEqual([], reviewer.buttons())
Exemplo n.º 15
0
 def test_list_decks(self):
     reviewer = Reviewer(FakeCollection(3, 1))
     reviewer.init()
     self.assertEqual([{'deckid': 1, 'deckname': 'deck1'}, {'deckid': 2, 'deckname': 'deck2'}], reviewer.list_decks())
Exemplo n.º 16
0
 def test_current_deck(self):
     reviewer = Reviewer(FakeCollection(3, 1))
     reviewer.init()
     self.assertEqual('deck1', reviewer.current_deck())
Exemplo n.º 17
0
 def test_get_answer_some(self):
     reviewer = Reviewer(FakeCollection(3, 1))
     reviewer.init()
     self.assertEqual('fake answer', reviewer.get_answer())