Skip to content
Permalink
Browse files
chore: add testing (ongoing)
  • Loading branch information
subotic committed Jun 6, 2019
1 parent 324731e commit c175a167f6d04be2054a4ffbeb47030db70c6f8f
@@ -564,3 +564,11 @@ For local development:
```bash
$ python3 setup.py develop
```
## Testing
```bash
$ pip3 install pytest
$ pip3 install --editable .
$ pytest
```
@@ -1,5 +1,6 @@
from .knora import KnoraError
from .knora import Knora
from .knora import Sipi
from .knora import BulkImport
from .knora import IrisLookup
from .knora import ListsLookup
@@ -3,3 +3,4 @@ setuptools
wheel
tqdm
twine
pytest
File renamed without changes.
@@ -0,0 +1,18 @@
import pytest

# we reuse a bit of pytest's own testing machinery, this should eventually come
# from a separatedly installable pytest-cli plugin.
pytest_plugins = ["pytester"]

@pytest.fixture
def run(testdir):
def do_run(*args):
args = ["knora-create-ontology"] + list(args)
return testdir._run(*args)
return do_run


def test_create_test_onto(tmpdir, run):
input = tmpdir.join("test-onto.json")
result = run(input)
assert result.ret == 0
@@ -4,7 +4,7 @@
import argparse
import json
from jsonschema import validate
from knora import KnoraError, knora, Sipi
from knora import KnoraError, Knora, Sipi


parser = argparse.ArgumentParser()
@@ -18,7 +18,7 @@
args = parser.parse_args()


con = knora(args.server, args.user, args.password)
con = Knora(args.server, args.user, args.password)
graph = con.get_ontology_graph('00FE', 'kpt')
#print(graph)
#exit(0)

0 comments on commit c175a16

Please sign in to comment.