Пример #1
0
 def test_output_dir_doesnt_exist(self, tmp_path, dats_path):
     # If the output dir does not exist when we call gen_jsonld_outpath
     # Then we want this to error out here
     # We only create output directories at the start
     out_path = tmp_path / "nonexistent"
     with pytest.raises(Exception):
         gen_jsonld_outpath(dats_path, out_path)
Пример #2
0
 def test_output_dir_fails(self, tmp_path, dats_path):
     out_path = tmp_path / "some" / "arbitrary" / "path"
     with pytest.raises(Exception):
         gen_jsonld_outpath(dats_path, out_path)
Пример #3
0
 def test_output_is_file(self, tmp_path, dats_path):
     out_path = tmp_path / "output_here_please.jsonld"
     result_path = gen_jsonld_outpath(str(dats_path), str(out_path))
     assert result_path == out_path
Пример #4
0
 def test_paths_are_string(self, tmp_path, dats_path):
     out_path = tmp_path / "jsonld_out"
     out_path.mkdir()
     result_path = gen_jsonld_outpath(str(dats_path), str(out_path))
     assert result_path == out_path / "dats_root_DATS.jsonld"
Пример #5
0
 def test_output_path_is_none(self, tmp_path, dats_path):
     dats_path.parent.mkdir()
     out_path = None
     result_path = gen_jsonld_outpath(dats_path, out_path)
     assert result_path == dats_path.parent / "DATS.jsonld"
Пример #6
0
 def test_output_dir_does_exist(self, tmp_path, dats_path):
     out_path = tmp_path / "jsonld_out"
     out_path.mkdir()
     result_path = gen_jsonld_outpath(dats_path, out_path)
     assert result_path == out_path / "dats_root_DATS.jsonld"