Ejemplo n.º 1
0
def accounts():
    '''
    An empty UserCollection
    '''
    with patch('users.sql'):
        faked = users.UserCollection()
    return faked
Ejemplo n.º 2
0
def init_user_collection():
    '''
    Creates and returns a new instance
    of UserCollection
    '''
    logger.info('Creating a new UserCollection')
    return users.UserCollection()
Ejemplo n.º 3
0
def init_user_collection():
    """
    Creates and returns a new instance
    of UserCollection
    """
    collection = users.UserCollection()
    logger.debug('collection = users.UserCollection()')

    return collection
Ejemplo n.º 4
0
def test_user_collection_init():
    '''
    Test creation of UserCollection
    '''
    # pylint: disable=E1101
    with patch('users.sql'):
        result = users.UserCollection()
        assert isinstance(result, users.UserCollection)
        result.database.create_tables.assert_called_with([result.table])
Ejemplo n.º 5
0
def test_user_collection_init(dict_keys):
    '''
    Test creation of UserCollection
    '''
    # pylint: disable=E1101
    with patch('users.sql') as mocker:
        result = users.UserCollection()
        assert isinstance(result, users.UserCollection)
        assert result.db_conn == mocker.DBConnection.return_value
        (result.db_conn.social['UserTable'].create_index.called_with(
            dict_keys[0], unique=True))
Ejemplo n.º 6
0
def collection():
    collection = users.UserCollection()

    return collection
Ejemplo n.º 7
0
def csv_collection(csv_database):
    collection = users.UserCollection()

    collection.database = csv_database

    return collection
Ejemplo n.º 8
0
def init_user_collection():
    '''
    Creates and returns a new instance 
    of UserCollection
    '''
    return users.UserCollection()