def METHOD_NAME(accounts, s3_client, mocker):
    s3_client.create_bucket(Bucket="some-bucket")
    expected = []
    # Putting more than 1000 keys
    for i in range(0, 1010):
        key = f"/some-file-{i}"
        expected.append(key)
        s3_client.put_object(
            Bucket="some-bucket", Key=f"state/integration{key}", Body=f"{i}"
        )
    # S3 response is sorted
    expected.sort()
    mock_aws_api = mocker.patch("reconcile.utils.state.AWSApi", autospec=True)
    mock_aws_api.return_value.get_session_client.return_value = s3_client
    state = _init_state_from_accounts(
        integration="integration",
        bucket_name=BUCKET,
        account_name=ACCOUNT,
        accounts=accounts,
        secret_reader=ConfigSecretReader(),
    )
    keys = state.ls()
    assert keys == expected