Skip to content

Commit

Permalink
Test for issue #10
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersanp committed Feb 18, 2018
1 parent 9915390 commit cbd6336
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/test_csvtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
os.environ['LANGUAGE'] = 'C'

from csvtools import csv2dict, dict2csv
from setup import eol, encoding
from setup import eol, encoding, delimiter


class TestCsvTools(unittest.TestCase):

def test_csv2dict(self):
_, tmp_path = mkstemp()
with codecs.open(tmp_path, 'w', encoding) as csv_file:
csv_file.write(u'á;x%sé;y%s' % (eol, eol))
csv_file.write(u'á%sx%sé%sy%s' % (delimiter, eol, delimiter, eol))
a_dict = csv2dict(tmp_path, {})
self.assertEquals(a_dict, {u'á':u'x', u'é':u'y'})

Expand All @@ -25,5 +25,5 @@ def test_dict2csv(self):
dict2csv(tmp_path, {u'á':'x', u'é':'y'})
with codecs.open(tmp_path, 'r', encoding) as csv_file:
text = csv_file.read()
self.assertEquals(text, u'á;x%sé;y%s' % (eol, eol))
self.assertEquals(text, u'á%sx%sé%sy%s' % (delimiter, eol, delimiter, eol))

0 comments on commit cbd6336

Please sign in to comment.