def test_check_sid_raise(ds: IdexDatastream): ds._sid = 'sid:one' msg = {'sid': 'sid:another'} with pytest.raises(IdexResponseSidError): ds._check_sid(msg)
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'
def test_check_sid_not_raise(ds: IdexDatastream): ds._sid = 'sid:one' msg = {'sid': ds._sid} ds._check_sid(msg)