diff --git a/qt/python/mantidqt/project/test/test_plotssaver.py b/qt/python/mantidqt/project/test/test_plotssaver.py index 4c98f48c8ba3201ec6b0f1d5e73fa7ffe33a99c9..c2d6dc985d86846a5b5755fd06d0b9d42b3e4476 100644 --- a/qt/python/mantidqt/project/test/test_plotssaver.py +++ b/qt/python/mantidqt/project/test/test_plotssaver.py @@ -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) diff --git a/qt/python/mantidqt/widgets/plotconfigdialog/test/test_apply_all_properties.py b/qt/python/mantidqt/widgets/plotconfigdialog/test/test_apply_all_properties.py index d80e198069d38707141b083a80b6d95d6920553e..142baa29fbdb5d94be52dbe0d96270873ac130f7 100644 --- a/qt/python/mantidqt/widgets/plotconfigdialog/test/test_apply_all_properties.py +++ b/qt/python/mantidqt/widgets/plotconfigdialog/test/test_apply_all_properties.py @@ -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())