Exemplo n.º 1
0
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')
Exemplo n.º 2
0
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')
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
def test_get_rotation_none():
    from matplotlib import text
    assert text.get_rotation(None) == 0.0
Exemplo n.º 5
0
def test_get_rotation_int():
    from matplotlib import text
    for i in [67, 16, 41]:
        assert text.get_rotation(i) == float(i)
Exemplo n.º 6
0
def test_get_rotation_float():
    from matplotlib import text
    for i in [15., 16.70, 77.4]:
        assert text.get_rotation(i) == i
Exemplo n.º 7
0
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.
Exemplo n.º 8
0
def test_get_rotation_raises():
    from matplotlib import text
    with pytest.raises(ValueError):
        text.get_rotation('hozirontal')
Exemplo n.º 9
0
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)
Exemplo n.º 10
0
def test_get_rotation_none():
    from matplotlib import text
    assert text.get_rotation(None) == 0.0
Exemplo n.º 11
0
def test_get_rotation_raises():
    from matplotlib import text
    with assert_raises(ValueError):
        text.get_rotation('hozirontal')
Exemplo n.º 12
0
def test_get_rotation_int():
    from matplotlib import text
    for i in [67, 16, 41]:
        assert text.get_rotation(i) == float(i)
Exemplo n.º 13
0
def test_get_rotation_float():
    from matplotlib import text
    for i in [15., 16.70, 77.4]:
        assert text.get_rotation(i) == i
Exemplo n.º 14
0
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.
Exemplo n.º 15
0
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