def METHOD_NAME():
    # There are already some tests in test_api.py, but this is a regression
    # test for the bug in issue #1319 which caused incorrect formatting of the
    # seconds for precision=0
    angle = Angle(-1.23456789, unit=u.degree)
    assert angle.to_string(precision=3) == "-1d14m04.444s"
    assert angle.to_string(precision=1) == "-1d14m04.4s"
    assert angle.to_string(precision=0) == "-1d14m04s"
    angle2 = Angle(-1.23456789, unit=u.hourangle)
    assert angle2.to_string(precision=3, unit=u.hour) == "-1h14m04.444s"
    assert angle2.to_string(precision=1, unit=u.hour) == "-1h14m04.4s"
    assert angle2.to_string(precision=0, unit=u.hour) == "-1h14m04s"
    # Regression test for #7141
    angle3 = Angle(-0.5, unit=u.degree)
    assert angle3.to_string(precision=0, fields=3) == "-0d30m00s"
    assert angle3.to_string(precision=0, fields=2) == "-0d30m"
    assert angle3.to_string(precision=0, fields=1) == "-1d"