Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
2f929149
Commit
2f929149
authored
5 years ago
by
Conor Finn
Browse files
Options
Downloads
Patches
Plain Diff
RE #28227 Add test for ragged colorbar normalise toggle
parent
706cfc16
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qt/applications/workbench/workbench/plotting/test/test_figureinteraction.py
+14
-1
14 additions, 1 deletion
...rkbench/workbench/plotting/test/test_figureinteraction.py
with
14 additions
and
1 deletion
qt/applications/workbench/workbench/plotting/test/test_figureinteraction.py
+
14
−
1
View file @
2f929149
...
...
@@ -27,7 +27,7 @@ from mantid.plots import MantidAxes
from
mantid.py3compat.mock
import
MagicMock
,
PropertyMock
,
call
,
patch
from
mantid.simpleapi
import
CreateWorkspace
from
mantidqt.plotting.figuretype
import
FigureType
from
mantidqt.plotting.functions
import
plot
from
mantidqt.plotting.functions
import
plot
,
pcolormesh_from_names
from
mantidqt.utils.qt.testing
import
start_qapplication
from
workbench.plotting.figureinteraction
import
FigureInteraction
...
...
@@ -378,6 +378,19 @@ class FigureInteractionTest(unittest.TestCase):
current_scale_types2
=
(
ax
.
get_xscale
(),
ax
.
get_yscale
())
self
.
assertNotEqual
(
current_scale_types2
,
current_scale_types1
)
def
test_scale_on_ragged_workspaces_maintained_when_toggling_normalisation
(
self
):
ws
=
CreateWorkspace
(
DataX
=
[
1
,
2
,
3
,
4
,
2
,
4
,
6
,
8
],
DataY
=
[
2
]
*
8
,
NSpec
=
2
,
OutputWorkspace
=
"
ragged_ws
"
)
fig
=
pcolormesh_from_names
([
ws
])
mock_canvas
=
MagicMock
(
figure
=
fig
)
fig_manager_mock
=
MagicMock
(
canvas
=
mock_canvas
)
fig_interactor
=
FigureInteraction
(
fig_manager_mock
)
fig_interactor
.
_toggle_normalization
(
fig
.
axes
[
0
])
clim
=
fig
.
axes
[
0
].
images
[
0
].
get_clim
()
fig_interactor
.
_toggle_normalization
(
fig
.
axes
[
0
])
self
.
assertEqual
(
clim
,
fig
.
axes
[
0
].
images
[
0
].
get_clim
())
self
.
assertNotEqual
((
-
0.1
,
0.1
),
fig
.
axes
[
0
].
images
[
0
].
get_clim
())
# Private methods
def
_create_mock_fig_manager_to_accept_right_click
(
self
):
fig_manager
=
MagicMock
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment