Skip to content

Commit

Permalink
save test string as base64 for python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedh committed Jan 3, 2020
1 parent a261c9f commit 3cb05bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import time
import shutil
import timeit
import base64
import inspect
import logging
import platform
Expand Down
5 changes: 4 additions & 1 deletion tests/test_dxf.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ def test_unicode(self):
# get a base 2D model
m = g.get_mesh('2D/wrench.dxf')
# make one of the entity layers a unicode string
m.entities[0].layer = 'TRAÇADOHORIZONTAL_TRAÇADO4'
# store it as B64 so python2 doesn't get mad
layer = g.base64.b64decode(
'VFJBw4dBRE9IT1JJWk9OVEFMX1RSQcOHQURPNA==').decode('utf-8')
m.entities[0].layer = layer
# export to a string
export = m.export(file_type='dxf')
# if any unicode survived the export this will fail
Expand Down

0 comments on commit 3cb05bf

Please sign in to comment.