Javi Merino | 7f3c8a6 | 2014-06-13 11:38:58 +0100 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | |
| 3 | import unittest |
| 4 | |
| 5 | import plot_utils |
| 6 | |
| 7 | class TestPlotUtils(unittest.TestCase): |
| 8 | def test_set_plot_size(self): |
| 9 | """Test that plot_utils.set_plot_size() doesn't bomb""" |
| 10 | plot_utils.set_plot_size(None, None) |
| 11 | plot_utils.set_plot_size(height=9, width=None) |
| 12 | plot_utils.set_plot_size(height=None, width=9) |
| 13 | plot_utils.set_plot_size(3, 9) |
| 14 | |
| 15 | def test_normalize_title(self): |
| 16 | """Test normalize_title""" |
| 17 | self.assertEquals(plot_utils.normalize_title("Foo", ""), "Foo") |
| 18 | self.assertEquals(plot_utils.normalize_title("Foo", "Bar"), "Bar - Foo") |
Javi Merino | 3a73655 | 2014-06-19 19:22:44 +0100 | [diff] [blame^] | 19 | |
| 20 | def test_post_plot_setup(self): |
| 21 | """Test that post_plot_setup() doesn't bomb""" |
| 22 | |
| 23 | ax = plot_utils.pre_plot_setup() |
| 24 | |
| 25 | plot_utils.post_plot_setup(ax) |
| 26 | plot_utils.post_plot_setup(ax, title="Foo") |
| 27 | plot_utils.post_plot_setup(ax, ylim=(0, 72)) |