def test_resolve_paths_require_dir_not_a_dir(monkeypatch, tmp_path): create_file(tmp_path / 'path/foo') create_file(tmp_path / 'path/bar') monkeypatch.chdir(tmp_path) cfg = Configuration(src_dirs="foo,bar,quux") with pytest.raises(UserInputError) as excinfo: cfg.resolve_paths(Path('path/foo.cfg')) assert str(excinfo.value) \ == f"src_dir: not a directory: '{tmp_path}/path/foo'"
def test_resolve_paths_nonexistent(monkeypatch, tmp_path): create_file(tmp_path / 'path/foo') create_file(tmp_path / 'path/bar') monkeypatch.chdir(tmp_path) cfg = Configuration(package_paths="foo,bar,quux") with pytest.raises(UserInputError) as excinfo: cfg.resolve_paths(Path('path/foo.cfg')) assert str(excinfo.value) == ( f"package: no such file or directory: '{tmp_path}/path/quux'")