Пример #1
0
def statuses():
    '''
    An empty StatusCollection
    '''
    with patch('user_status.sql'):
        faked = user_status.UserStatusCollection()
    return faked
Пример #2
0
def init_status_collection():
    '''
    Creates and returns a new instance
    of UserStatusCollection
    '''
    logger.info('Createing a new UserStatusCollection')
    return user_status.UserStatusCollection()
Пример #3
0
def init_status_collection():
    """
    Creates and returns a new instance
    of UserStatusCollection
    """
    stati = user_status.UserStatusCollection()
    logger.debug('stati = user_status.UserStatusCollection()')

    return stati
Пример #4
0
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])
Пример #5
0
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))
Пример #6
0
def status_collection():
    collection = user_status.UserStatusCollection()

    return collection
Пример #7
0
def init_status_collection():
    '''
    Creates and returns a new instance
    of UserStatusCollection
    '''
    return user_status.UserStatusCollection()