#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Boilerplate
#-----------------------------------------------------------------------------
from __future__ import annotations # isort:skip

import pytest ; pytest

#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------

# External imports
from tornado.ioloop import IOLoop

# Bokeh imports
from bokeh.client.states import NOT_YET_CONNECTED

# Module under test
import bokeh.client.connection as bcc # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

class FakeSess:
    id = "session_id"

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

class Test_ClientConnection:
    def test_creation(self) -> None:
        c = bcc.ClientConnection("session", "wsurl")
        assert c.url == "wsurl"
        assert c.connected is False
        assert isinstance(c.io_loop, IOLoop)

        assert c._session == "session"
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments is None

    def test_creation_with_arguments(self) -> None:
        c = bcc.ClientConnection("session", "wsurl", arguments=dict(foo="bar"))
        assert c.url == "wsurl"
        assert c.connected is False
        assert isinstance(c.io_loop, IOLoop)

        assert c._session == "session"
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments == dict(foo="bar")

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------

b553a0261ae666ac507cc7cf7e45212315873a97
<mask token>


class FakeSess:
    <mask token>


class Test_ClientConnection:

    def test_creation(self) ->None:
        c = bcc.ClientConnection('session', 'wsurl')
        assert c.url == 'wsurl'
        assert c.connected is False
        assert isinstance(c.io_loop, IOLoop)
        assert c._session == 'session'
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments is None

    def test_creation_with_arguments(self) ->None:
        c = bcc.ClientConnection('session', 'wsurl', arguments=dict(foo='bar'))
        assert c.url == 'wsurl'
        assert c.connected is False
        assert isinstance(c.io_loop, IOLoop)
        assert c._session == 'session'
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments == dict(foo='bar')

<mask token>


class FakeSess:
    id = 'session_id'


class Test_ClientConnection:

    def test_creation(self) ->None:
        c = bcc.ClientConnection('session', 'wsurl')
        assert c.url == 'wsurl'
        assert c.connected is False
        assert isinstance(c.io_loop, IOLoop)
        assert c._session == 'session'
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments is None

    def test_creation_with_arguments(self) ->None:
        c = bcc.ClientConnection('session', 'wsurl', arguments=dict(foo='bar'))
        assert c.url == 'wsurl'
        assert c.connected is False
        assert isinstance(c.io_loop, IOLoop)
        assert c._session == 'session'
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments == dict(foo='bar')

<mask token>
pytest
<mask token>


class FakeSess:
    id = 'session_id'


class Test_ClientConnection:

    def test_creation(self) ->None:
        c = bcc.ClientConnection('session', 'wsurl')
        assert c.url == 'wsurl'
        assert c.connected is False
        assert isinstance(c.io_loop, IOLoop)
        assert c._session == 'session'
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments is None

    def test_creation_with_arguments(self) ->None:
        c = bcc.ClientConnection('session', 'wsurl', arguments=dict(foo='bar'))
        assert c.url == 'wsurl'
        assert c.connected is False
        assert isinstance(c.io_loop, IOLoop)
        assert c._session == 'session'
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments == dict(foo='bar')

from __future__ import annotations
import pytest
pytest
from tornado.ioloop import IOLoop
from bokeh.client.states import NOT_YET_CONNECTED
import bokeh.client.connection as bcc


class FakeSess:
    id = 'session_id'


class Test_ClientConnection:

    def test_creation(self) ->None:
        c = bcc.ClientConnection('session', 'wsurl')
        assert c.url == 'wsurl'
        assert c.connected is False
        assert isinstance(c.io_loop, IOLoop)
        assert c._session == 'session'
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments is None

    def test_creation_with_arguments(self) ->None:
        c = bcc.ClientConnection('session', 'wsurl', arguments=dict(foo='bar'))
        assert c.url == 'wsurl'
        assert c.connected is False
        assert isinstance(c.io_loop, IOLoop)
        assert c._session == 'session'
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments == dict(foo='bar')

#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Boilerplate
#-----------------------------------------------------------------------------
from __future__ import annotations # isort:skip

import pytest ; pytest

#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------

# External imports
from tornado.ioloop import IOLoop

# Bokeh imports
from bokeh.client.states import NOT_YET_CONNECTED

# Module under test
import bokeh.client.connection as bcc # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

class FakeSess:
    id = "session_id"

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

class Test_ClientConnection:
    def test_creation(self) -> None:
        c = bcc.ClientConnection("session", "wsurl")
        assert c.url == "wsurl"
        assert c.connected is False
        assert isinstance(c.io_loop, IOLoop)

        assert c._session == "session"
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments is None

    def test_creation_with_arguments(self) -> None:
        c = bcc.ClientConnection("session", "wsurl", arguments=dict(foo="bar"))
        assert c.url == "wsurl"
        assert c.connected is False
        assert isinstance(c.io_loop, IOLoop)

        assert c._session == "session"
        assert isinstance(c._state, NOT_YET_CONNECTED)
        assert c._until_predicate is None
        assert c._server_info is None
        assert c._arguments == dict(foo="bar")

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------
