def statuses(): ''' An empty StatusCollection ''' with patch('user_status.sql'): faked = user_status.UserStatusCollection() return faked
def init_status_collection(): ''' Creates and returns a new instance of UserStatusCollection ''' logger.info('Createing a new UserStatusCollection') return user_status.UserStatusCollection()
def init_status_collection(): """ Creates and returns a new instance of UserStatusCollection """ stati = user_status.UserStatusCollection() logger.debug('stati = user_status.UserStatusCollection()') return stati
def test_user_status_collection_init(): ''' Test creation of UserStatusCollection ''' # pylint: disable=E1101 with patch('user_status.sql'): result = user_status.UserStatusCollection() assert isinstance(result, user_status.UserStatusCollection) result.database.execute_sql.assert_called_with('PRAGMA foreign_keys = ON;') result.database.create_tables.assert_called_with([result.table])
def test_user_status_collection_init(dict_keys): ''' Test creation of UserStatusCollection ''' # pylint: disable=E1101 with patch('user_status.sql') as mocker: result = user_status.UserStatusCollection() assert isinstance(result, user_status.UserStatusCollection) assert result.db_conn == mocker.DBConnection.return_value (result.db_conn.social['StatusTable'] .create_index .called_with(dict_keys[0], unique=True))
def status_collection(): collection = user_status.UserStatusCollection() return collection
def init_status_collection(): ''' Creates and returns a new instance of UserStatusCollection ''' return user_status.UserStatusCollection()