Пример #1
0
def test_check_sid_raise(ds: IdexDatastream):
    ds._sid = 'sid:one'

    msg = {'sid': 'sid:another'}

    with pytest.raises(IdexResponseSidError):
        ds._check_sid(msg)
Пример #2
0
def test_sid_equal(ds: IdexDatastream):
    ds._logger.info = Mock()

    ds._sid = 'some_sid'
    ds._set_sid('some_sid')

    ds._logger.info.assert_not_called()
    assert ds._sid == 'some_sid'
Пример #3
0
def test_check_sid_not_raise(ds: IdexDatastream):
    ds._sid = 'sid:one'

    msg = {'sid': ds._sid}

    ds._check_sid(msg)