def METHOD_NAME(self):
    for max_sites in range(10):
        ab = _tsinfer.AncestorBuilder(num_samples=2, max_sites=max_sites)
        for _ in range(max_sites):
            ab.add_site(time=1, genotypes=[0, 1])
        for _ in range(2 * max_sites):
            with pytest.raises(_tsinfer.LibraryError) as record:
                ab.add_site(time=1, genotypes=[0, 1])
            msg = "Cannot add more sites than the specified maximum."
            assert str(record.value) == msg