Esempio n. 1
0
def test_close_connection_socket_error(mocker: MockerFixture, under_test: x3270):
    mocker.patch("Mainframe3270.py3270.Emulator.terminate", side_effect=socket.error)
    under_test.close_connection()

    assert under_test.mf is None
Esempio n. 2
0
def test_close_connection(mocker: MockerFixture, under_test: x3270):
    mocker.patch("Mainframe3270.py3270.Emulator.terminate")
    under_test.close_connection()

    assert Emulator.terminate.called_once()
    assert under_test.mf is None