Skip to content
Snippets Groups Projects
Commit 5cf608fb authored by Phil's avatar Phil
Browse files

Re #26596 font tests

parent f4403743
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@
from __future__ import (absolute_import, division, print_function, unicode_literals)
import matplotlib
import platform
import unittest
from mantid.api import AnalysisDataService as ADS
......@@ -127,6 +128,11 @@ class PlotsSaverTest(unittest.TestCase):
self.loader_plot_dict[u'creationArguments'] = [[{u"specNum": 2, "function": "plot"}]]
# The original font isn't available on Windows so it has to be changed.
if platform.system() == "Windows":
self.loader_plot_dict[u'axes'][0][u'legend'][u'entries_font'] = 'DejaVu Sans'
self.loader_plot_dict[u'axes'][0][u'legend'][u'title_font'] = 'DejaVu Sans'
self.maxDiff = None
self.assertDictEqual(return_value, self.loader_plot_dict)
......@@ -136,6 +142,11 @@ class PlotsSaverTest(unittest.TestCase):
expected_value = self.loader_plot_dict["axes"][0]
# The original font isn't available on Windows so it has to be changed.
if platform.system() == "Windows":
self.loader_plot_dict[u'axes'][0][u'legend'][u'entries_font'] = 'DejaVu Sans'
self.loader_plot_dict[u'axes'][0][u'legend'][u'title_font'] = 'DejaVu Sans'
self.maxDiff = None
self.assertDictEqual(return_value, expected_value)
......
......@@ -6,6 +6,7 @@
# SPDX - License - Identifier: GPL - 3.0 +
# This file is part of the mantid workbench.
import platform
import unittest
import matplotlib
......@@ -308,6 +309,8 @@ class ApplyAllPropertiesTest(unittest.TestCase):
self.new_legend.get_frame().get_alpha())
def test_apply_properties_on_figure_with_legend_sets_entries_font(self):
if platform.system() == "Windows":
new_legend_props['entries_font'] = 'DejaVu Sans'
self.assertEqual(new_legend_props['entries_font'],
self.new_legend.get_texts()[0].get_fontname())
......@@ -320,6 +323,8 @@ class ApplyAllPropertiesTest(unittest.TestCase):
self.new_legend.get_texts()[0].get_color())
def test_apply_properties_on_figure_with_legend_sets_title_font(self):
if platform.system() == "Windows":
new_legend_props['title_font'] = 'DejaVu Sans'
self.assertEqual(new_legend_props['title_font'],
self.new_legend.get_title().get_fontname())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment