<s> __author__ = '<STR_LIT>' <EOL> from nose . plugins . attrib import attr <EOL> from pyon . datastore . datastore import DatastoreManager , DatastoreFactory <EOL> from pyon . core . bootstrap import CFG <EOL> from pyon . util . int_test import IonIntegrationTestCase <EOL> @ attr ( '<STR_LIT>' , group = '<STR_LIT>' ) <EOL> class TestCoverage ( IonIntegrationTestCase ) : <EOL> def setUp ( self ) : <EOL> self . _start_container ( ) <EOL> def test_coverage ( self ) : <EOL> datastore = DatastoreFactory . get_datastore ( datastore_name = '<STR_LIT>' , config = CFG ) <EOL> table_name = datastore . _get_datastore_name ( ) <EOL> delete_statement = '<STR_LIT>' . join ( [ '<STR_LIT>' , table_name , "<STR_LIT>" ] ) <EOL> with datastore . pool . cursor ( ** datastore . cursor_args ) as cur : <EOL> cur . execute ( delete_statement ) <EOL> statement = '<STR_LIT>' . join ( [ '<STR_LIT>' , table_name , "<STR_LIT>" ] ) <EOL> with datastore . pool . cursor ( ** datastore . cursor_args ) as cur : <EOL> cur . execute ( statement ) <EOL> statement = '<STR_LIT>' . join ( [ '<STR_LIT>' , table_name , "<STR_LIT>" ] ) <EOL> with datastore . pool . cursor ( ** datastore . cursor_args ) as cur : <EOL> cur . execute ( statement ) <EOL> self . assertGreater ( cur . rowcount , <NUM_LIT:0> ) <EOL> row = cur . fetchone ( ) <EOL> self . assertEqual ( row [ <NUM_LIT:0> ] , '<STR_LIT:test>' ) <EOL> self . assertEqual ( row [ <NUM_LIT:1> ] , '<STR_LIT>' ) <EOL> with datastore . pool . cursor ( ** datastore . cursor_args ) as cur : <EOL> cur . execute ( delete_statement ) <EOL> def test_spans ( self ) : <EOL> datastore = DatastoreFactory . get_datastore ( datastore_name = '<STR_LIT>' , config = CFG ) <EOL> table_name = datastore . _get_datastore_name ( ) <EOL> delete_statement = '<STR_LIT>' . join ( [ '<STR_LIT>' , table_name , "<STR_LIT>" ] ) <EOL> with datastore . pool . cursor ( ** datastore . cursor_args ) as cur : <EOL> cur . execute ( delete_statement ) <EOL> statement = '<STR_LIT>' . join ( [ '<STR_LIT>' , table_name , "<STR_LIT>" , <EOL> "<STR_LIT>" ] ) <EOL> with datastore . pool . cursor ( ** datastore . cursor_args ) as cur : <EOL> cur . execute ( statement ) <EOL> statement = '<STR_LIT>' . join ( [ '<STR_LIT>' , <EOL> table_name , "<STR_LIT>" ] ) <EOL> with datastore . pool . cursor ( ** datastore . cursor_args ) as cur : <EOL> cur . execute ( statement ) <EOL> self . assertGreater ( cur . rowcount , <NUM_LIT:0> ) <EOL> row = cur . fetchone ( ) <EOL> self . assertEqual ( row [ <NUM_LIT:0> ] , '<STR_LIT:test>' ) <EOL> self . assertEqual ( row [ <NUM_LIT:1> ] , '<STR_LIT>' ) <EOL> self . assertEqual ( float ( row [ <NUM_LIT:2> ] ) , float ( <NUM_LIT:1.0> ) ) <EOL> self . assertEqual ( float ( row [ <NUM_LIT:3> ] ) , float ( <NUM_LIT> ) ) <EOL> with datastore . pool . cursor ( ** datastore . cursor_args ) as cur : <EOL> cur . execute ( delete_statement ) </s>
