def test_get_rotation_raises(): from matplotlib import text import sys if sys.version_info[:2] < (2, 7): raise SkipTest("assert_raises as context manager " "not supported with Python < 2.7") with assert_raises(ValueError): text.get_rotation('hozirontal')
def test_get_rotation_mod360(): from matplotlib import text for i, j in zip([360., 377., 720 + 177.2], [0., 17., 177.2]): assert_almost_equal(text.get_rotation(i), j)
def test_get_rotation_none(): from matplotlib import text assert text.get_rotation(None) == 0.0
def test_get_rotation_int(): from matplotlib import text for i in [67, 16, 41]: assert text.get_rotation(i) == float(i)
def test_get_rotation_float(): from matplotlib import text for i in [15., 16.70, 77.4]: assert text.get_rotation(i) == i
def test_get_rotation_string(): from matplotlib import text assert text.get_rotation('horizontal') == 0. assert text.get_rotation('vertical') == 90. assert text.get_rotation('15.') == 15.
def test_get_rotation_raises(): from matplotlib import text with pytest.raises(ValueError): text.get_rotation('hozirontal')
def test_get_rotation_mod360(): from matplotlib import text for i, j in zip([360., 377., 720+177.2], [0., 17., 177.2]): assert_almost_equal(text.get_rotation(i), j)
def test_get_rotation_raises(): from matplotlib import text with assert_raises(ValueError): text.get_rotation('hozirontal')
def test_get_rotation_string(): from matplotlib import text assert text.get_rotation("horizontal") == 0.0 assert text.get_rotation("vertical") == 90.0 assert text.get_rotation("15.") == 15.0