Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
chore: add testing (ongoing)
  • Loading branch information
subotic committed Jun 6, 2019
1 parent 324731e commit c175a16
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -564,3 +564,11 @@ For local development:
```bash
$ python3 setup.py develop
```

## Testing

```bash
$ pip3 install pytest
$ pip3 install --editable .
$ pytest
```
1 change: 1 addition & 0 deletions knora/__init__.py
@@ -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
1 change: 1 addition & 0 deletions requirements.txt
Expand Up @@ -3,3 +3,4 @@ setuptools
wheel
tqdm
twine
pytest
File renamed without changes.
18 changes: 18 additions & 0 deletions tests/test_create_ontology.py
@@ -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
Expand Up @@ -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()
Expand All @@ -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)
Expand Down

0 comments on commit c175a16

Please sign in to comment.