Skip to content

Commit

Permalink
Create ttl-file only once with join cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
dalito committed Mar 9, 2024
1 parent 612d245 commit b940ce0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change log

## Release 0.8.4 (2024-03-09)

Bug fixes:

- Fix creation of two ttl-files for sub-command "join" with "--outbox" option. (#215 fixed in #216)

## Release 0.8.4 (2024-03-04)

Bug fixes:
Expand Down
1 change: 0 additions & 1 deletion src/voc4cat/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def join_split_turtle(vocab_dir: Path) -> Graph:
)
cs_graph += tg

cs_graph.serialize(destination=vocab_dir.with_suffix(".ttl"), format="turtle")
return cs_graph


Expand Down
10 changes: 5 additions & 5 deletions tests/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

import pytest
from openpyxl import load_workbook
from rdflib import Graph, Literal
from rdflib.namespace import DCTERMS, OWL, SKOS, XSD
from rdflib import DCTERMS, OWL, SKOS, XSD, Graph, Literal
from test_cli import (
CS_CYCLES,
CS_CYCLES_INDENT_DOT,
Expand Down Expand Up @@ -599,17 +598,18 @@ def test_join(monkeypatch, datadir, tmp_path, opt, caplog):
cmd.append(str(tmp_path))

with caplog.at_level(logging.DEBUG):
print("cmd:", cmd)
main_cli(cmd)
assert "-> joined vocabulary into" in caplog.text

vocdir = (tmp_path / CS_SIMPLE_TURTLE).with_suffix("")
assert (vocdir.parent / CS_SIMPLE_TURTLE).exists()
if opt == "inplace":
assert not vocdir.exists()
assert (vocdir.parent / CS_SIMPLE_TURTLE).exists()
elif opt == "outdir":
print("\nout (?):", (tmp_path / "outdir" / CS_SIMPLE_TURTLE))
assert (tmp_path / "outdir" / CS_SIMPLE_TURTLE).exists()
assert not (vocdir.parent / CS_SIMPLE_TURTLE).exists()
else:
assert (vocdir.parent / CS_SIMPLE_TURTLE).exists()


@mock.patch.dict(
Expand Down

0 comments on commit b940ce0

Please sign in to comment.