Ejemplo n.º 1
0
    def test_json(self):
        try:
            import json
        except ImportError:
            try:
                import simplejson as json
            except ImportError:
                return

        t = TableFu(self.csv_file)
        self.csv_file.seek(0)
        reader = csv.DictReader(self.csv_file)
        jsoned = json.dumps([row for row in reader])
        self.assertEqual(t.json(), jsoned)
Ejemplo n.º 2
0
 def test_json(self):
     try:
         import json
     except ImportError:
         try:
             import simplejson as json
         except ImportError:
             return
     
     t = TableFu(self.csv_file)
     self.csv_file.seek(0)
     reader = csv.DictReader(self.csv_file)
     jsoned = json.dumps([row for row in reader])
     self.assertEqual(t.json(), jsoned)