Commit 8ce2f4e9 by lrnzcig

automated test of json2csv function

initial version for review
parent 490bba63
'''
Created on 6 de may. de 2015
@author: lorenzorubio
'''
import unittest
import os
import filecmp
from nltk.twitter.util import guess_path, json2csv, json2csv_entities
class Test(unittest.TestCase):
def setUp(self):
from nltk.corpus import tweets
self.inpf = tweets.abspath("tweets.20150430-223406.json")
pass
def tearDown(self):
pass
def testTextOutput(self):
outf = os.path.join(guess_path("twitter-files"), 'tweets.20150430-223406.text.csv')
json2csv(self.inpf, outf,
['text'])
assert filecmp.cmp(outf,
'tweets.20150430-223406.text.csv.ref'), 'Error in csv file'
if __name__ == "__main__":
unittest.main()
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment