Пример #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')
Пример #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')
Пример #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)
Пример #4
0
def test_get_rotation_none():
    from matplotlib import text
    assert text.get_rotation(None) == 0.0
Пример #5
0
def test_get_rotation_int():
    from matplotlib import text
    for i in [67, 16, 41]:
        assert text.get_rotation(i) == float(i)
Пример #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
Пример #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.
Пример #8
0
def test_get_rotation_raises():
    from matplotlib import text
    with pytest.raises(ValueError):
        text.get_rotation('hozirontal')
Пример #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)
Пример #10
0
def test_get_rotation_none():
    from matplotlib import text
    assert text.get_rotation(None) == 0.0
Пример #11
0
def test_get_rotation_raises():
    from matplotlib import text
    with assert_raises(ValueError):
        text.get_rotation('hozirontal')
Пример #12
0
def test_get_rotation_int():
    from matplotlib import text
    for i in [67, 16, 41]:
        assert text.get_rotation(i) == float(i)
Пример #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
Пример #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.
Пример #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