Beispiel #1
0
def test_load_skills_complains_missing_skills(load_yaml):
    randomPath = str(random.randint(0, 1000))
    expected_error = 'Module file "{}/module.yaml" needs to have a list of skills'.format(
        randomPath)
    with pytest.raises(RuntimeError, match=expected_error):
        _load_skills(randomPath, skills=None, course=fakes.course1)
Beispiel #2
0
 def test_handles_every_module(self, load_skill):
     load_skill.return_value = fakes.fake_value()
     assert _load_skills("foo", ["bar", "baz"],
                         fakes.course1) == [load_skill.return_value] * 2
Beispiel #3
0
 def test_calls_load_skills_with_correct_arguments(self, load_skill):
     _load_skills("foo", ["bar.yaml"], fakes.course1)
     load_skill.assert_called_with(Path("foo/skills/bar.yaml"),
                                   fakes.course1)
Beispiel #4
0
 def test_returns_correct_value(self, load_skill):
     load_skill.return_value = fakes.fake_value()
     assert _load_skills("foo", ["bar"],
                         fakes.course1) == [load_skill.return_value]