Beispiel #1
0
 def test_calls_load_skills_with_correct_arguments(self, load_skill):
     load_skills("foo", ["bar.yaml"])
     load_skill.assert_called_with(Path("foo/skills/bar.yaml"))
Beispiel #2
0
 def test_returns_correct_value(self, load_skill):
     load_skill.return_value = fakes.fake_value()
     assert load_skills("foo", ["bar"]) == [load_skill.return_value]
Beispiel #3
0
 def test_handles_every_module(self, load_skill):
     load_skill.return_value = fakes.fake_value()
     assert load_skills("foo",
                        ["bar", "baz"]) == [load_skill.return_value] * 2
Beispiel #4
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)