예제 #1
0
 def test_doesnt_include_chips_if_sentence_is_short(self):
     assert len(list(filter(
         lambda x: x["type"] == "chips", get_phrase_challenges(
             fakes.customize(
                 fakes.phrase1,
                 in_target_language=["foo"],
                 in_source_language=["bar"],
             ), fakes.course1)))) == 0
예제 #2
0
 def setUp(self):
     self.groups = []
     self.ids = []
     challenges = get_phrase_challenges(fakes.phrase1, fakes.course1)
     for challenge in challenges:
         self.groups.append(challenge["group"])
         self.ids.append(challenge["id"])
     assert len(self.groups) > 1
     assert len(self.ids) > 1
예제 #3
0
 def test_returns_correct_number_of_challenged(self):
     assert len(get_phrase_challenges(
         fakes.long_phrase, fakes.course1)) == 4
예제 #4
0
 def test_includes_reverse_chips_challenge(self, mock):
     fake_value = fakes.fake_value()
     mock.return_value = fake_value
     assert get_phrase_challenges(
         fakes.long_phrase, fakes.course1)[3] == fake_value
예제 #5
0
 def test_includes_listening_challenge(self, mock):
     fake_value = fakes.fake_value()
     mock.return_value = fake_value
     assert get_phrase_challenges(
         fakes.phrase1, fakes.course1)[1] == fake_value
예제 #6
0
 def test_includes_options_challenges(self, mock):
     fake_value = fakes.fake_value()
     mock.return_value = fake_value
     assert get_phrase_challenges(
         fakes.phrase1, fakes.course1)[0] == fake_value