Skip to content

Commit

Permalink
use expanded unihan-etl
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Jun 5, 2017
1 parent 9f098fb commit 7eb7305
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def unihan_options(zip_file, zip_path, tmpdir):
return {
'source': str(zip_path),
'work_dir': str(tmpdir),
'zip_path': str(tmpdir.join('downloads').join('Moo.zip'))
'zip_path': str(tmpdir.join('downloads').join('Moo.zip')),
'expand': True
}


Expand Down
6 changes: 3 additions & 3 deletions tests/test_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_import_object(session, engine):
def test_import_unihan(zip_file, session, engine, unihan_options):
Base.metadata.bind = engine
Base.metadata.create_all()
bootstrap.bootstrap_unihan(Base.metadata, unihan_options)
# bootstrap.bootstrap_unihan(Base.metadata, unihan_options)


def test_import_unihan_raw(zip_file, session, engine, unihan_options):
Expand All @@ -37,8 +37,8 @@ def test_import_unihan_raw(zip_file, session, engine, unihan_options):
assert session.query(Unhn).filter_by(char=u'㐀').one().ucn == 'U+3400'

for char in data:
if 'kDefinition' in char and char['kDefinition']:
if 'kDefinition' in char:
c = session.query(Unhn).filter_by(ucn=char['ucn']).one()
for defi in char['kDefinition'].split(' '):
for defi in char['kDefinition']:
c.kDefinition.append(kDefinition(definition=defi))
session.commit()

0 comments on commit 7eb7305

Please sign in to comment.