Exemplo n.º 1
0
 def test_formats_challenges_correctly(self, mock):
     get_skill_data(fakes.skills[1], fakes.course1)
     mock.assert_called_with(fakes.skills[1], fakes.course1)
Exemplo n.º 2
0
 def test_correct_challenges(self, mock):
     FAKE_CHALLENGES = "fake challenges"
     mock.return_value = FAKE_CHALLENGES
     converted_skill = get_skill_data(fakes.skills[1], fakes.course1)
     assert converted_skill["challenges"] == FAKE_CHALLENGES
Exemplo n.º 3
0
 def test_correct_number_of_levels(self, mock):
     FAKE_NUMBER = "fake number"
     mock.return_value = FAKE_NUMBER
     converted_skill = get_skill_data(fakes.emptySkill, fakes.course1)
     assert converted_skill["levels"] == FAKE_NUMBER
Exemplo n.º 4
0
 def test_calculates_levels_correctly(self, mock):
     get_skill_data(fakes.skills[1], fakes.course1)
     mock.assert_called_with(4, 1)
Exemplo n.º 5
0
 def test_empty_skill(self):
     assert get_skill_data(fakes.emptySkill, fakes.courseEmpty) == {
         "id": "d7279e4777cd",
         "levels": 1,
         "challenges": []
     }