Commits

Charlie Clark  committed c89caf6

Use Encoder factory.

  • Participants
  • Parent commits c107b99

Comments (0)

Files changed (9)

+€}q(U	collectorqUcoverage v3.5.2qUlinesq}q(UN/Users/charlieclark/Sites/data-table/gviz-data-table/gviz_data_table/column.pyq]q(KKKKKK	K
+]q
+K
+eUM/Users/charlieclark/Sites/data-table/gviz-data-table/gviz_data_table/table.pyq]q(KKKKKKKKKKKK
+K
+K
+K
+K
+syntax: glob
+dist/gviz_data_table-0.9.0.tar.gz
+dist/gviz_data_table-0.9.1.tar.gz

File docs/docs.rst

+docs Package
+============
+
+:mod:`conf` Module
+------------------
+
+.. automodule:: docs.conf
+    :members:
+    :undoc-members:
+    :show-inheritance:
+

File docs/examples.rst

+examples Package
+================
+
+:mod:`example` Module
+---------------------
+
+.. automodule:: examples.example
+    :members:
+    :undoc-members:
+    :show-inheritance:
+

File docs/gviz_data_table.tests.rst

+tests Package
+=============
+
+:mod:`tests_cell` Module
+------------------------
+
+.. automodule:: gviz_data_table.tests.tests_cell
+    :members:
+    :undoc-members:
+    :show-inheritance:
+
+:mod:`tests_column` Module
+--------------------------
+
+.. automodule:: gviz_data_table.tests.tests_column
+    :members:
+    :undoc-members:
+    :show-inheritance:
+
+:mod:`tests_encoder` Module
+---------------------------
+
+.. automodule:: gviz_data_table.tests.tests_encoder
+    :members:
+    :undoc-members:
+    :show-inheritance:
+
+:mod:`tests_table` Module
+-------------------------
+
+.. automodule:: gviz_data_table.tests.tests_table
+    :members:
+    :undoc-members:
+    :show-inheritance:
+

File docs/modules.rst

+.
+=
+
+.. toctree::
+   :maxdepth: 4
+
+   docs
+   examples
+   gviz_data_table
+   setup

File docs/setup.rst

+setup Module
+============
+
+.. automodule:: setup
+    :members:
+    :undoc-members:
+    :show-inheritance:

File gviz_data_table/.coverage

+€}q(U	collectorqUcoverage v3.5.2qUlinesq}q(UN/Users/charlieclark/Sites/data-table/gviz-data-table/gviz_data_table/column.pyq]UO/Users/charlieclark/Sites/data-table/gviz-data-table/gviz_data_table/encoder.pyq]UZ/Users/charlieclark/Sites/data-table/gviz-data-table/gviz_data_table/tests/tests_column.pyq]UP/Users/charlieclark/Sites/data-table/gviz-data-table/gviz_data_table/__init__.pyq	]UM/Users/charlieclark/Sites/data-table/gviz-data-table/gviz_data_table/table.pyq
+]UL/Users/charlieclark/Sites/data-table/gviz-data-table/gviz_data_table/cell.pyq

File gviz_data_table/tests/test_encoder.py

 import pytest
-from gviz_data_table.encoder import Encoder
+from gviz_data_table.encoder import encoder
 
 import datetime
 import json
 
 def test_encode_time():
     time = datetime.time(10, 30, 45)
-    encoder = Encoder()
     js = encoder.encode(time)
     python = json.loads(js)
     assert python == [10, 30, 45]
 
 def test_encode_date():
     today = datetime.date(2012, 1, 31)
-    encoder = Encoder()
     js = encoder.encode(today)
     python = json.loads(js)
     assert python == "Date(2012, 0, 31)"
 
 def test_encode_datetime():
     today = datetime.datetime(2012, 1, 31, 12, 30, 45)
-    encoder = Encoder()
     js = encoder.encode(today)
     python = json.loads(js)
     assert python == "Date(2012, 0, 31, 12, 30, 45)"
 def test_encode_cell():
     from gviz_data_table.cell import Cell
     c = Cell(int, 1)
-    encoder = Encoder()
     js = encoder.encode(c)
     python = json.loads(js)
     assert python == {"v": 1}
 def test_encode_column():
     from gviz_data_table.column import Column
     schema = Column(id='age', type=int)
-    encoder = Encoder()
     js = encoder.encode(schema)
     python = json.loads(js)
     assert python == {"type": "number", "id": "age", "label": "age"}
 def test_encode_table():
     from gviz_data_table.table import Table
     table = Table()
-    encoder = Encoder()
     js = encoder.encode(table)
     python = json.loads(js)
     assert python == {'rows':[], 'cols':[]}
 
 def test_encode_unknown():
-    encoder = Encoder()
     with pytest.raises(TypeError):
         encoder.encode(object)