Skip to content

Commit 09aa698

Browse files
committed
update existing tests
1 parent 1da02fa commit 09aa698

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Framework/Kernel/test/ErrorReporterTest.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class ErrorReporterTest : public CxxTest::TestSuite {
6666
const std::string appName = "My testing application name";
6767
const Mantid::Types::Core::time_duration upTime(5, 0, 7, 0);
6868
const std::string stackTrace = "File \" C :\\file\\path\\file.py\", line 194, in broken_function";
69-
TestableErrorReporter reporter(appName, upTime, "0", true, "name", "email", "textBox", stackTrace);
69+
TestableErrorReporter reporter(appName, upTime, "0", true, "name", "email", "textBox", stackTrace, "");
7070
const std::string message = reporter.generateErrorMessage();
7171

7272
::Json::Value root;
@@ -102,7 +102,7 @@ class ErrorReporterTest : public CxxTest::TestSuite {
102102
void test_errorMessageWithShareAndRecoveryFileHash() {
103103
const std::string name = "My testing application name";
104104
const Mantid::Types::Core::time_duration upTime(5, 0, 7, 0);
105-
TestableErrorReporter errorService(name, upTime, "0", true, "name", "email", "textBox", "stacktrace");
105+
TestableErrorReporter errorService(name, upTime, "0", true, "name", "email", "textBox", "stacktrace", "cppTraces");
106106
const std::string message = errorService.generateErrorMessage();
107107

108108
::Json::Value root;
@@ -111,7 +111,7 @@ class ErrorReporterTest : public CxxTest::TestSuite {
111111
const std::vector<std::string> expectedMembers{
112112
"ParaView", "application", "host", "mantidSha1", "mantidVersion", "osArch",
113113
"osName", "osReadable", "osVersion", "uid", "facility", "upTime",
114-
"exitCode", "textBox", "name", "email", "stacktrace"};
114+
"exitCode", "textBox", "name", "email", "stacktrace", "cppCompressedTraces"};
115115
for (auto expectedMember : expectedMembers) {
116116
TSM_ASSERT(expectedMember + " not found",
117117
std::find(members.begin(), members.end(), expectedMember) != members.end());
@@ -124,12 +124,13 @@ class ErrorReporterTest : public CxxTest::TestSuite {
124124
TS_ASSERT_EQUALS(root["email"].asString(), "email");
125125
TS_ASSERT_EQUALS(root["textBox"].asString(), "textBox");
126126
TS_ASSERT_EQUALS(root["stacktrace"].asString(), "stacktrace");
127+
TS_ASSERT_EQUALS(root["cppCompressedTraces"].asString(), "cppTraces");
127128
}
128129

129130
void test_errorMessageWithNoShareAndRecoveryFileHash() {
130131
const std::string name = "My testing application name";
131132
const Mantid::Types::Core::time_duration upTime(5, 0, 7, 0);
132-
TestableErrorReporter errorService(name, upTime, "0", false, "name", "email", "textBox", "stacktrace");
133+
TestableErrorReporter errorService(name, upTime, "0", false, "name", "email", "textBox", "stacktrace", "cppTraces");
133134
const std::string message = errorService.generateErrorMessage();
134135

135136
::Json::Value root;
@@ -138,7 +139,8 @@ class ErrorReporterTest : public CxxTest::TestSuite {
138139
const std::vector<std::string> expectedMembers{
139140
"ParaView", "application", "host", "mantidSha1", "mantidVersion", "osArch",
140141
"osName", "osReadable", "osVersion", "uid", "facility", "upTime",
141-
"exitCode", "textBox", "name", "email", "stacktrace"};
142+
"exitCode", "textBox", "name", "email", "stacktrace", "upTime",
143+
"exitCode", "textBox", "name", "email", "stacktrace", "cppCompressedTraces"};
142144
for (auto expectedMember : expectedMembers) {
143145
TSM_ASSERT(expectedMember + " not found",
144146
std::find(members.begin(), members.end(), expectedMember) != members.end());
@@ -151,5 +153,6 @@ class ErrorReporterTest : public CxxTest::TestSuite {
151153
TS_ASSERT_EQUALS(root["email"].asString(), "");
152154
TS_ASSERT_EQUALS(root["textBox"].asString(), "textBox");
153155
TS_ASSERT_EQUALS(root["stacktrace"].asString(), "");
156+
TS_ASSERT_EQUALS(root["cppCompressedTraces"].asString(), "");
154157
}
155158
};

qt/python/mantidqt/mantidqt/dialogs/errorreports/test/test_errorreport_presenter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def test_send_error_report_to_server_calls_ErrorReport_correctly(self):
6262
self.errorreport_mock_instance.sendErrorReport.return_value = 201
6363
self.error_report_presenter._send_report_to_server(False, name=name, email=email, uptime=uptime, text_box=text_box)
6464

65-
self.errorreport_mock.assert_called_once_with(self.app_name, uptime, self.exit_code, False, name, email, text_box, "")
65+
self.errorreport_mock.assert_called_once_with(self.app_name, uptime, self.exit_code, False, name, email, text_box, "", b"")
6666
self.errorreport_mock_instance.sendErrorReport.assert_called_once_with()
6767

6868
def test_send_error_report_to_server_calls_ErrorReport_correctly_and_triggers_view_upon_failure(self):
@@ -74,7 +74,7 @@ def test_send_error_report_to_server_calls_ErrorReport_correctly_and_triggers_vi
7474
self.errorreport_mock_instance.sendErrorReport.return_value = 500
7575
self.error_report_presenter._send_report_to_server(True, name=name, email=email, uptime=uptime, text_box=text_box)
7676

77-
self.errorreport_mock.assert_called_once_with(self.app_name, uptime, self.exit_code, True, name, email, text_box, "")
77+
self.errorreport_mock.assert_called_once_with(self.app_name, uptime, self.exit_code, True, name, email, text_box, "", b"")
7878
self.errorreport_mock_instance.sendErrorReport.assert_called_once_with()
7979
self.view.display_message_box.assert_called_once_with(
8080
"Error contacting server", ErrorReporterPresenter.SENDING_ERROR_MESSAGE, "http request returned with status 500"

0 commit comments

Comments
 (0)