carepoint.tests.db package

Submodules

carepoint.tests.db.db module

class carepoint.tests.db.db.DatabaseTest(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]
classmethod setUpClass()[source]
tearDown()[source]
classmethod tearDownClass()[source]

carepoint.tests.db.test_carepoint module

class carepoint.tests.db.test_carepoint.CarepointTest(methodName='runTest')[source]

Bases: unittest.case.TestCase

MODEL_DIR = '/home/travis/build/LasLabs/python-carepoint/carepoint/tests/db/test_models'
setUp(*args, **keywargs)[source]
test_carepoint_assigns_db_params()[source]

It should assign the database params as an instance var

test_carepoint_assigns_instance_env()[source]
test_carepoint_init(*args, **keywargs)[source]
test_carepoint_initial_iter_refresh()[source]
test_cph_db_assign()[source]
test_cph_db_init()[source]
test_create_adds_new_record_to_session()[source]
test_create_calls_get_model_session_with_model_obj()[source]
test_create_criterion_raises_attribute_error()[source]
test_create_criterion_raises_not_implemented_error()[source]
test_create_criterion_returns_correct_double_eq()[source]
test_create_criterion_returns_correct_eq()[source]
test_create_criterion_returns_correct_ge()[source]
test_create_criterion_returns_correct_gt()[source]
test_create_criterion_returns_correct_le()[source]
test_create_criterion_returns_correct_lt()[source]
test_create_initializes_new_model_obj_with_vals()[source]
test_create_returns_new_record()[source]
test_delete_asserts_result_count_eq_1()[source]
test_delete_calls_get_model_session_with_model_obj()[source]
test_delete_calls_read_with_model_and_record_id()[source]
test_delete_calls_session_delete_with_record_result()[source]
test_delete_returns_false_on_no_records()[source]
test_delete_returns_true_on_delete()[source]
test_get_file_builds_opener(*args, **keywargs)[source]
test_get_file_opens_uri(*args, **keywargs)[source]
test_get_file_returns_opened_handler(*args, **keywargs)[source]
test_get_model_session_close()[source]

It should always close session

test_get_model_session_commit()[source]

It should commit session after yield

test_get_model_session_gets_session()[source]

It should get session for the database

test_get_model_session_rollback()[source]

It should roll session back on error

test_get_model_session_yields_session()[source]

It should yield session for the database

test_get_next_sequence_execute(*args, **keywargs)[source]

It should execute stored procedure on connection

test_get_next_sequence_fetch()[source]

It should return result of fetch

test_get_next_sequence_session()[source]

It should get session for db

test_init_env_clear()[source]

It should clear the global environment when True

test_items_after_refresh()[source]
test_items_init_empty()[source]
test_iter_after_refresh()[source]
test_iter_init_empty()[source]
test_iteritems_after_refresh()[source]
test_iteritems_init_empty()[source]
test_iterkeys_after_refresh()[source]
test_iterkeys_init_empty()[source]
test_itervalues_after_refresh()[source]
test_itervalues_init_empty()[source]
test_keys_after_refresh()[source]
test_keys_init_empty()[source]
test_model_import_getattr()[source]

Test if model is correctly initialized

test_model_import_getitem()[source]

Test if model is correctly initialized

test_model_methods()[source]

Test if model is correctly initialized

test_non_dir()[source]

Test to make sure that an EnvironmentError is raised with an invalid model dir

test_read_calls_get_with_record_id()[source]
test_read_calls_query_with_model_obj()[source]
test_read_returns_response()[source]
test_search_calls_filter_when_no_filters()[source]
test_search_calls_filter_with_filters()[source]
test_search_calls_query_with_model_obj()[source]
test_search_returns_response()[source]
test_send_file_builds_opener(*args, **keywargs)[source]
test_send_file_returns_true(*args, **keywargs)[source]
test_send_file_sends_file(*args, **keywargs)[source]
test_set_iter_refresh()[source]
test_smb_prefix()[source]
test_unwrap_filters_dict()[source]
test_unwrap_filters_empty()[source]
test_unwrap_filters_list(*args, **keywargs)[source]

It should create a proper or query for lists.

test_unwrap_filters_none()[source]
test_unwrap_filters_returns_list()[source]
test_unwrap_filters_str()[source]
test_update_calls_get_model_session_with_model_obj()[source]
test_update_calls_read_with_model_and_record_id()[source]
test_update_calls_update_with_vals()[source]
test_update_returns_record()[source]
test_values_after_refresh()[source]
test_values_init_empty()[source]
test_wrong_model_getattr()[source]

Test to verify that a KeyError is raised for invalid model name

test_wrong_model_getitem()[source]

Test to verify that a KeyError is raised for invalid model name

exception carepoint.tests.db.test_carepoint.EndTestException[source]

Bases: exceptions.Exception

carepoint.tests.db.test_db module

class carepoint.tests.db.test_db.TestDb(methodName='runTest')[source]

Bases: unittest.case.TestCase

setUp()[source]
test_mssql_dsn(*args, **keywargs)[source]
test_mssql_dsn_return(*args, **keywargs)[source]
test_sqlite_dsn(*args, **keywargs)[source]
test_sqlite_dsn_return(*args, **keywargs)[source]

Module contents