def test_rest_simplify():
    r1 = noise.Rest(10)
    r1.simplify()
    assert r1.complexity() == 1
def test_rest_get_duration():
    r1 = noise.Rest(20)
    assert abs(r1.get_duration() - 20) < 0.0001
def test_rest_get_waves():
    r1 = noise.Rest(1)
    assert all(w.play().max() == 0 for w in r1.get_waves())
    assert all(w.play().min() == 0 for w in r1.get_waves())
def test_rest_play():
    r1 = noise.Rest(1)
    assert r1.play().max() == 0
    assert r1.play().min() == 0
def test_rest_complexity():
    r1 = noise.Rest(10)
    assert r1.complexity() > 0
def test_rest_add():
    r1 = noise.Rest(10)
    s1 = noise.SimpleWave(100, 10, 1)
    w1 = r1 + s1
    np.testing.assert_allclose(s1.play(), w1.play(), atol=0.0001)