Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
cb38adb0
Unverified
Commit
cb38adb0
authored
Mar 20, 2020
by
Nick Draper
Committed by
GitHub
Mar 20, 2020
Browse files
Merge pull request #28402 from mantidproject/RemoveERsystest
Remove ErrorReporterServerTest
parents
1b82395b
7b5df7e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Testing/SystemTests/tests/analysis/ErrorReporterServerTest.py
deleted
100644 → 0
View file @
1b82395b
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from
mantid.py3compat
import
mock
import
systemtesting
from
ErrorReporter.error_report_presenter
import
ErrorReporterPresenter
# noqa
class
ErrorReportServerTests
(
systemtesting
.
MantidSystemTest
):
def
setUp
(
self
):
mock_view
=
mock
.
MagicMock
()
self
.
error_report_presenter
=
ErrorReporterPresenter
(
mock_view
,
'1'
)
def
test_no_share_sends_nothing
(
self
):
status
=
self
.
error_report_presenter
.
error_handler
(
True
,
2
,
''
,
''
,
''
)
self
.
assertEqual
(
status
,
-
1
)
def
test_share_non_identifiable_returns_created_status
(
self
):
status
=
self
.
error_report_presenter
.
error_handler
(
True
,
1
,
''
,
''
,
''
)
self
.
assertEqual
(
status
,
201
)
def
test_share_identifiable_works_for_empty_values
(
self
):
status
=
self
.
error_report_presenter
.
error_handler
(
True
,
0
,
''
,
''
,
''
)
self
.
assertEqual
(
status
,
201
)
def
test_share_identifiable_works_for_just_name
(
self
):
status
=
self
.
error_report_presenter
.
error_handler
(
True
,
0
,
'public_name'
,
''
,
''
)
self
.
assertEqual
(
status
,
201
)
def
test_share_identifiable_works_for_just_email
(
self
):
status
=
self
.
error_report_presenter
.
error_handler
(
True
,
0
,
''
,
'public_email'
,
''
)
self
.
assertEqual
(
status
,
201
)
def
test_share_identifiable_works_for_just_textbox
(
self
):
status
=
self
.
error_report_presenter
.
error_handler
(
True
,
0
,
''
,
''
,
'Something went wrong'
)
self
.
assertEqual
(
status
,
201
)
def
test_share_identifiable_works_with_no_name
(
self
):
status
=
self
.
error_report_presenter
.
error_handler
(
True
,
0
,
''
,
'public_email'
,
'Something went wrong'
)
self
.
assertEqual
(
status
,
201
)
def
test_share_identifiable_works_with_no_email
(
self
):
status
=
self
.
error_report_presenter
.
error_handler
(
True
,
0
,
'public_name'
,
''
,
'Something went wrong'
)
self
.
assertEqual
(
status
,
201
)
def
test_share_identifiable_works_with_no_textbox
(
self
):
status
=
self
.
error_report_presenter
.
error_handler
(
True
,
0
,
'public_name'
,
'public_email'
,
''
)
self
.
assertEqual
(
status
,
201
)
def
test_share_identifiable_works_with_all
(
self
):
status
=
self
.
error_report_presenter
.
error_handler
(
True
,
0
,
'public_name'
,
'public_email'
,
'Something went wrong'
)
self
.
assertEqual
(
status
,
201
)
def
excludeInPullRequests
(
self
):
return
True
def
runTest
(
self
):
self
.
setUp
()
self
.
test_no_share_sends_nothing
()
self
.
test_share_non_identifiable_returns_created_status
()
self
.
test_share_identifiable_works_for_empty_values
()
self
.
test_share_identifiable_works_for_just_name
()
self
.
test_share_identifiable_works_for_just_email
()
self
.
test_share_identifiable_works_for_just_textbox
()
self
.
test_share_identifiable_works_with_no_name
()
self
.
test_share_identifiable_works_with_no_email
()
self
.
test_share_identifiable_works_with_no_textbox
()
self
.
test_share_identifiable_works_with_all
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment