diff options
author | bnewbold <bnewbold@robocracy.org> | 2016-01-25 13:26:08 -0800 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2016-01-25 13:26:08 -0800 |
commit | 3b5cd220c997db5dec98120eccd963f868d0ecad (patch) | |
tree | 993a948cc8692ae6a46acec00ce3c08e77d0a574 /tests/test_json.py | |
parent | d67921d73e26d006da25c48f37c87e4179f86eff (diff) | |
download | basebasebase-3b5cd220c997db5dec98120eccd963f868d0ecad.tar.gz basebasebase-3b5cd220c997db5dec98120eccd963f868d0ecad.zip |
tests: simple json load test
Diffstat (limited to 'tests/test_json.py')
-rw-r--r-- | tests/test_json.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_json.py b/tests/test_json.py new file mode 100644 index 0000000..19dfc18 --- /dev/null +++ b/tests/test_json.py @@ -0,0 +1,27 @@ +""" +This file contains tests that parse and dump JSON serialized entities. + +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 TestJSON(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) |