示例#1
0
    def test_spec_loader1(self):
        spec_dir = os.path.join(
            os.path.dirname(__file__),
            'data')

        spec_repo = AnodSpecRepository(spec_dir)
        s = spec_repo.load('loader1')
        assert s.name == 'loader1'
示例#2
0
    def test_spec_loader2(self):
        spec_dir = os.path.join(
            os.path.dirname(__file__),
            'data')

        spec_repo = AnodSpecRepository(spec_dir)

        with pytest.raises(SandBoxError) as err:
            spec_repo.load('loader2')
        assert str(err.value).startswith(
            'load: cannot find Anod subclass in')