Added sample user data for use in tests.
This commit is contained in:
parent
fbfd4932e6
commit
92347da966
6
tests.py
6
tests.py
@ -1,4 +1,4 @@
|
|||||||
import codecs
|
import gzip
|
||||||
import ujson as json
|
import ujson as json
|
||||||
import unittest
|
import unittest
|
||||||
from wanikaniburned import app, db, User, datetime_format, parse_range
|
from wanikaniburned import app, db, User, datetime_format, parse_range
|
||||||
@ -97,8 +97,8 @@ class TestFormats(unittest.TestCase):
|
|||||||
|
|
||||||
class TestUserItems(BaseTestCase):
|
class TestUserItems(BaseTestCase):
|
||||||
|
|
||||||
with codecs.open('testuserdata.json', encoding='utf-8') as input_file:
|
with gzip.open("testuserdata.json.gz", "rb") as input_file:
|
||||||
user_data = json.load(input_file)
|
user_data = json.loads(input_file.read().decode('utf8'))
|
||||||
user_radicals = user_data['radicals']
|
user_radicals = user_data['radicals']
|
||||||
user_kanji = user_data['kanji']
|
user_kanji = user_data['kanji']
|
||||||
user_vocabulary = user_data['vocabulary']
|
user_vocabulary = user_data['vocabulary']
|
||||||
|
BIN
testuserdata.json.gz
Normal file
BIN
testuserdata.json.gz
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user