def test_direct_transport_unsupported(mocker): "Test that we get an error running on an unsupported platform" mock_direct = mocker.patch('itoolkit.transport.direct._direct', create=True) mock_direct.xmlservice = mocker.Mock(side_effect=NameError) transport = DirectTransport() tk = iToolKit() with pytest.raises(RuntimeError): transport.call(tk)
def test_direct_transport_call_raises_when_closed(mocker): mock = mock_direct(mocker) transport = DirectTransport() transport.close() with pytest.raises(TransportClosedException): tk = iToolKit() out = transport.call(tk)
def test_direct_transport(mocker): mock = mock_direct(mocker) transport = DirectTransport() tk = iToolKit() out = transport.call(tk) assert_xmlservice_params_correct(mock) assert isinstance(out, (bytes, str))