Tidy & add test_refine commentary.

This commit is contained in:
Paul Makepeace 2011-04-26 14:55:18 -04:00
parent bde4eb7466
commit 5f8437327a
3 changed files with 14 additions and 5 deletions

View File

@ -18,8 +18,8 @@ import urlparse
from google.refine import facet 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') REFINE_HOST = os.environ.get('GOOGLE_REFINE_HOST', '127.0.0.1')
REFINE_PORT = os.environ.get('GOOGLE_REFINE_PORT', '3333')
class RefineServer(object): class RefineServer(object):
@ -156,7 +156,6 @@ def RowsResponseFactory(column_index):
Uses the project's model's row cell index so that a row can be used Uses the project's model's row cell index so that a row can be used
as a dict by column name.""" as a dict by column name."""
print 'COL_IND', column_index
class RowsResponse(object): class RowsResponse(object):
class RefineRows(object): class RefineRows(object):
class RefineRow(object): class RefineRow(object):

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
""" """
test_engine.py test_facet.py
""" """
# Copyright (c) 2011 Paul Makepeace, Real Programmers. All rights reserved. # Copyright (c) 2011 Paul Makepeace, Real Programmers. All rights reserved.
@ -32,6 +32,7 @@ class CamelTest(unittest.TestCase):
for camel_attr, attr in pairs: for camel_attr, attr in pairs:
self.assertEqual(from_camel(camel_attr), attr) self.assertEqual(from_camel(camel_attr), attr)
class FacetTest(unittest.TestCase): class FacetTest(unittest.TestCase):
def test_init(self): def test_init(self):
facet = TextFacet('column name') facet = TextFacet('column name')
@ -120,4 +121,4 @@ class FacetTest(unittest.TestCase):
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()

View File

@ -1,6 +1,15 @@
#!/usr/bin/env python #!/usr/bin/env python
""" """
test_refine.py test_refine.py
The tests here are based on David Huynh's Refine tutorial at
http://davidhuynh.net/spaces/nicar2011/tutorial.pdf The tests perform all
the Refine actions given in the tutorial (except the web scraping) and verify
the changes expected to observe explained in the tutorial.
These tests require a connection to a Refine server either at
http://127.0.0.1:3333/ or by specifying environment variables REFINE_HOST
and REFINE_PORT.
""" """
# Copyright (c) 2011 Paul Makepeace, Real Programmers. All rights reserved. # Copyright (c) 2011 Paul Makepeace, Real Programmers. All rights reserved.
@ -455,4 +464,4 @@ class TutorialTestTransposeVariableNumbeOfRowsIntoColumns(RefineTestCase):
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()