summaryrefslogtreecommitdiffstats
path: root/tests/test_json.py
blob: 19dfc18c393c99eec61e8581e37a21de99f3f71d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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)