# Path: sevenbridges/errors.py
# class SbgError(Exception):
#     """Base class for SBG errors.
# 
#     Provides a base exception for all errors
#     that are thrown by sevenbridges-python library.
#     """
# 
#     def __init__(self, message=None, code=None, status=None, more_info=None):
#         """
#         :param code: Custom error code
#         :param status: Http status code.
#         :param message: Message describing the error.
#         """
#         self.code = code
#         self.status = status
#         self.message = message
#         self.more_info = more_info
# 
#     def __str__(self):
#         return str(self.message)


import faker
import pytest
from sevenbridges.errors import SbgError


def test_list_files_with_token(api, given, verifier):
    # precondition
    total = 10
    folder_id = generator.uuid4()
    given.file.exists(id=folder_id, type='folder')

    given.file.files_in_folder(
        num_of_files=total,
        folder_id=folder_id,
        scroll=True
    )

    # action
    folder = api.files.get(folder_id)
    response = folder.list_files(cont_token='init')

    # verification
    assert len(response) == total
    verifier.file.folder_files_listed_scroll(id=folder_id)


def test_list_files_with_token_and_offset(api, given, verifier):
    # precondition
    folder_id = generator.uuid4()
    given.file.exists(id=folder_id, type='folder')

    # action
    folder = api.files.get(folder_id)

# Path: sevenbridges/errors.py
# class SbgError(Exception):
#     """Base class for SBG errors.
# 
#     Provides a base exception for all errors
#     that are thrown by sevenbridges-python library.
#     """
# 
#     def __init__(self, message=None, code=None, status=None, more_info=None):
#         """
#         :param code: Custom error code
#         :param status: Http status code.
#         :param message: Message describing the error.
#         """
#         self.code = code
#         self.status = status
#         self.message = message
#         self.more_info = more_info
# 
#     def __str__(self):
#         return str(self.message)


# Path: tests/test_files.py
import faker
import pytest
from sevenbridges.errors import SbgError



def test_list_files_with_token(api, given, verifier):
    # precondition
    total = 10
    folder_id = generator.uuid4()
    given.file.exists(id=folder_id, type='folder')

    given.file.files_in_folder(
        num_of_files=total,
        folder_id=folder_id,
        scroll=True
    )

    # action
    folder = api.files.get(folder_id)
    response = folder.list_files(cont_token='init')

    # verification
    assert len(response) == total
    verifier.file.folder_files_listed_scroll(id=folder_id)


def test_list_files_with_token_and_offset(api, given, verifier):
    # precondition
    folder_id = generator.uuid4()
    given.file.exists(id=folder_id, type='folder')

    # action
    folder = api.files.get(folder_id)

    with pytest.raises(SbgError):