Move camel case testing to test_facet
This commit is contained in:
parent
e8beb422b7
commit
d5038c6618
|
@ -21,6 +21,7 @@ from google.refine import facet
|
|||
REFINE_PORT = os.environ.get('GOOGLE_REFINE_PORT', '3333')
|
||||
REFINE_HOST = os.environ.get('GOOGLE_REFINE_HOST', '127.0.0.1')
|
||||
|
||||
|
||||
class RefineServer(object):
|
||||
"""Communicate with a Refine server."""
|
||||
|
||||
|
@ -155,6 +156,7 @@ def RowsResponseFactory(column_index):
|
|||
Uses the project's model's row cell index so that a row can be used
|
||||
as a dict by column name."""
|
||||
|
||||
print 'COL_IND', column_index
|
||||
class RowsResponse(object):
|
||||
class RefineRows(object):
|
||||
class RefineRow(object):
|
||||
|
|
|
@ -11,6 +11,27 @@ import unittest
|
|||
from google.refine.facet import *
|
||||
|
||||
|
||||
class CamelTest(unittest.TestCase):
|
||||
def test_to_camel(self):
|
||||
pairs = (
|
||||
('this', 'this'),
|
||||
('this_attr', 'thisAttr'),
|
||||
('From', 'from'),
|
||||
)
|
||||
for attr, camel_attr in pairs:
|
||||
self.assertEqual(to_camel(attr), camel_attr)
|
||||
|
||||
def test_from_camel(self):
|
||||
pairs = (
|
||||
('this', 'this'),
|
||||
('This', 'this'),
|
||||
('thisAttr', 'this_attr'),
|
||||
('ThisAttr', 'this_attr'),
|
||||
('From', 'from'),
|
||||
)
|
||||
for camel_attr, attr in pairs:
|
||||
self.assertEqual(from_camel(camel_attr), attr)
|
||||
|
||||
class FacetTest(unittest.TestCase):
|
||||
def test_init(self):
|
||||
facet = TextFacet('column name')
|
||||
|
|
|
@ -14,28 +14,6 @@ from google.refine import facet
|
|||
PATH_TO_TEST_DATA = os.path.join('google', 'test', 'data')
|
||||
|
||||
|
||||
class CamelTest(unittest.TestCase):
|
||||
def test_to_camel(self):
|
||||
pairs = (
|
||||
('this', 'this'),
|
||||
('this_attr', 'thisAttr'),
|
||||
('From', 'from'),
|
||||
)
|
||||
for attr, camel_attr in pairs:
|
||||
self.assertEqual(facet.to_camel(attr), camel_attr)
|
||||
|
||||
def test_from_camel(self):
|
||||
pairs = (
|
||||
('this', 'this'),
|
||||
('This', 'this'),
|
||||
('thisAttr', 'this_attr'),
|
||||
('ThisAttr', 'this_attr'),
|
||||
('From', 'from'),
|
||||
)
|
||||
for camel_attr, attr in pairs:
|
||||
self.assertEqual(facet.from_camel(camel_attr), attr)
|
||||
|
||||
|
||||
class RefineTestCase(unittest.TestCase):
|
||||
project_file = None
|
||||
project_file_options = {}
|
||||
|
|
Loading…
Reference in New Issue