# Path: ricloud/samples/utils.py
# def await_response(resource, timeout=60):
#     """Poll the API until processing resolves or the timeout is reached."""
#     timeout_time = time.time() + timeout
#     while resource.state in ("pending", "processing") and time.time() < timeout_time:
# 
#         time.sleep(1)
# 
#         resource.refresh()


import pytest
import ricloud
from ricloud.samples.utils import await_response
from __future__ import absolute_import




USER_IDENTIFIER = "testing@reincubate.com"
SOURCE_IDENTIFIER = "john.appleseed@reincubate.com"


@pytest.mark.integration
class TestIntegration(object):
    def test_ok(self):
        user = ricloud.User.create(identifier=USER_IDENTIFIER)

        assert isinstance(user, ricloud.User)
        assert user.identifier == USER_IDENTIFIER

        session = ricloud.Session.create(
            source={
                "user": user,

# Path: ricloud/samples/utils.py
# def await_response(resource, timeout=60):
#     """Poll the API until processing resolves or the timeout is reached."""
#     timeout_time = time.time() + timeout
#     while resource.state in ("pending", "processing") and time.time() < timeout_time:
# 
#         time.sleep(1)
# 
#         resource.refresh()


# Path: tests/test_integration.py
import pytest
import ricloud
from ricloud.samples.utils import await_response

from __future__ import absolute_import




USER_IDENTIFIER = "testing@reincubate.com"
SOURCE_IDENTIFIER = "john.appleseed@reincubate.com"


@pytest.mark.integration
class TestIntegration(object):
    def test_ok(self):
        user = ricloud.User.create(identifier=USER_IDENTIFIER)

        assert isinstance(user, ricloud.User)
        assert user.identifier == USER_IDENTIFIER

        session = ricloud.Session.create(
            source={
                "user": user,

                "type": "mocks.mock",