Example #1
0
def test_remove_from_empty_list():
    """
    Test to see if it raises an exception
    when trying to remove data form a zero length dataset
    """
    # Setup
    avg = Averager(3)

    # Exercise/Verify
    with pytest.raises(IndexError):
        avg.remove_first_point()
Example #2
0
def test_remove_first_point():
    """Test removing the first point from the list."""
    # Setup
    avg = Averager()

    # Exercise
    avg.add_data(1)
    avg.add_data(2)
    avg.add_data(3)

    avg.remove_first_point()

    # Verify
    assert avg.data == [2, 3]
    assert avg.number_of_data_points == 2