diff options
author | bnewbold <bnewbold@robocracy.org> | 2016-01-25 14:13:00 -0800 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2016-01-25 14:13:00 -0800 |
commit | 161ad38959e7bea6967760c0418f90850f77a9c9 (patch) | |
tree | 8e984942d403d8b99f101e104a61adffbcb4dbb8 /tests/test_objects.py | |
parent | 5bcc6a37f76af99843dc82524bdf7c666da5eafd (diff) | |
download | basebasebase-161ad38959e7bea6967760c0418f90850f77a9c9.tar.gz basebasebase-161ad38959e7bea6967760c0418f90850f77a9c9.zip |
more tests
Diffstat (limited to 'tests/test_objects.py')
-rw-r--r-- | tests/test_objects.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/test_objects.py b/tests/test_objects.py new file mode 100644 index 0000000..7b1c6ac --- /dev/null +++ b/tests/test_objects.py @@ -0,0 +1,46 @@ +""" +This file contains tests for generic object classes. + +It requires the 'nose' python package. To run it, just enter this directory and +do: + + $ nosetests + +If there are errors it can be helpful to debug with: + + $ nosetests --pdb +""" + +from nose.tools import * +from nose.plugins.skip import SkipTest +import unittest +import random +import json + +from bbb import * + +class TestObjects(unittest.TestCase): + + def test_wikidata_org_item(self): + with open('tests/example_item_nyc.json', 'r') as f: + d = json.loads(''.join(f.readlines())) + wi = WikibaseItem.from_dict(d) + wi.qid() + wi.to_dict() + + def test_item(self): + WikibaseItem() + item = WikibaseItem({"en": "Some Item", "de": "Deutsch Item"}) + WikibaseItem("Some Label", "Some Description", ['Another Name'], "Q93594") + item.to_dict() + item.qid() + + def test_property(self): + prop = WikibaseProperty() + prop.to_dict() + prop.pid() + + def test_statement(self): + stmt = WikibaseStatement() + raise SkipTest("Not Implemented Yet") + stmt.to_dict() |