Move camel case testing to test_facet

This commit is contained in:
Paul Makepeace 2011-04-26 14:20:47 -04:00
parent e8beb422b7
commit d5038c6618
3 changed files with 23 additions and 22 deletions

View File

@ -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):

View File

@ -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')

View File

@ -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 = {}