def test_returns_correct_challenges(self, mock1, mock2): mock1.return_value = [fakes.challenge1, fakes.challenge2] mock2.return_value = [fakes.challenge3, fakes.challenge4] assert get_challenges_data(fakes.skillWithPhraseAndWord, fakes.course1) == [ fakes.challenge1, fakes.challenge2, fakes.challenge3, fakes.challenge4]
def test_includes_every_word(self, mock): get_challenges_data(fakes.skillWith3Words, fakes.course1) assert mock.call_count == 3
def test_generates_phrase_challenges_correctly(self, mock): get_challenges_data(fakes.skillWithPhrase, fakes.course1) mock.assert_called_with(fakes.phrase2, fakes.course1)
def test_generates_word_challenges_correctly(self, mock): get_challenges_data(fakes.skillWithWord, fakes.course1) mock.assert_called_with(fakes.word1, fakes.course1)
def test_empty_skill(self): assert get_challenges_data(fakes.emptySkill, fakes.course1) == []