def accounts(): ''' An empty UserCollection ''' with patch('users.sql'): faked = users.UserCollection() return faked
def init_user_collection(): ''' Creates and returns a new instance of UserCollection ''' logger.info('Creating a new UserCollection') return users.UserCollection()
def init_user_collection(): """ Creates and returns a new instance of UserCollection """ collection = users.UserCollection() logger.debug('collection = users.UserCollection()') return collection
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])
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))
def collection(): collection = users.UserCollection() return collection
def csv_collection(csv_database): collection = users.UserCollection() collection.database = csv_database return collection
def init_user_collection(): ''' Creates and returns a new instance of UserCollection ''' return users.UserCollection()