def reset_qt_signal(): """ Reset the QT signals between tests. Otherwise you can get callback on code from previous test. """ from gns3.qt import FakeQtSignal FakeQtSignal.reset()
def response(): response = unittest.mock.MagicMock() type(response).finished = unittest.mock.PropertyMock( return_value=FakeQtSignal()) response.error.return_value = QtNetwork.QNetworkReply.NoError response.attribute.return_value = 200 return response