Skip to content

Commit

Permalink
Set bib2lod parameters as agreed
Browse files Browse the repository at this point in the history
  • Loading branch information
zimeon committed Jun 2, 2017
1 parent 17cd1a0 commit a8c1ad5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
16 changes: 8 additions & 8 deletions test-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ Functional tests should accept three arguments:

## bib2lod configuration

* For each test the code will look for a config file named `config.json` in the current directory or a parent directory (working up from the current directory). If none is found then `test-data/config.json` will be used.
* The test makes the following commandline substitutions to the config values:
* InputService:class=org.ld4l.bib2lod.io.FileInputService
* InputService:source=<test input parameter>
* InputService:extension=<test extension parameter>
* OutputService:class=org.ld4l.bib2lod.io.FileOutputService
* OutputService:destination=<test output location>
* OutputService:format=N-TRIPLES
* For each test the code will look for a config file named `config.json` in the current directory or a parent directory (working up from the current directory). If none is found then `test-data/config.json` will be used.
* The test makes the following commandline substitutions to the config values:
* `InputService:class=org.ld4l.bib2lod.io.FileInputService`
* `InputService:source=<test input parameter>`
* `InputService:extension=<test extension parameter>`
* `OutputService:class=org.ld4l.bib2lod.io.FileOutputService`
* `OutputService:destination=<test output location>`
* `OutputService:format=N-TRIPLES`

### Error conditions

Expand Down
11 changes: 8 additions & 3 deletions testconv/conversion_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,17 @@ def check_conversion(self, src, ref):
# it will be the input file name with extension changed
# to that defined by the output format, in our case we
# assume '.nt'
outfile = os.path.splitext(infile)[0] + '.nt'
(src_base, src_ext) = os.path.splitext(infile)
outfile = src_base + '.nt'
dst = os.path.join(outdir, outfile)
out = run_bib2lod(
[config_filepath,
'--set', ('InputService:source=%s' % (src)),
'--set', ('OutputService:destination=%s' % (outdir))])
'--set', 'InputService:class=org.ld4l.bib2lod.io.FileInputService',
'--set', 'InputService:source=' + src,
'--set', 'InputService:extension=' + src_ext,
'--set', 'OutputService:class=org.ld4l.bib2lod.io.FileOutputService',
'--set', 'OutputService:destination=' + outdir,
'--set', 'OutputService:format=N-TRIPLES'])
if (not os.path.exists(dst)):
logging.error("%s - FAIL\n"
"Output file %s does not exist" %
Expand Down

0 comments on commit a8c1ad5

Please sign in to comment.