def test_union():
    t1 = HyperLogLog(range(10), b=5)
    t2 = HyperLogLog(range(10), b=5)
    t3 = HyperLogLog(range(20), b=5)

    t1.union(t2)
    assert set(t1.M) == set(t2.M)

    t1.union(t3)
    assert set(t1.M) == set(t3.M)

    t4 = HyperLogLog(range(10), b=4)
    try:
        t1.union(t4)
        raise Exception("Should have complained about parameters")
    except:
        pass
def test_union():
    t1 = HyperLogLog(range(10), b=5)
    t2 = HyperLogLog(range(10), b=5)
    t3 = HyperLogLog(range(20), b=5)

    t1.union(t2)
    assert set(t1.M) == set(t2.M)

    t1.union(t3)
    assert set(t1.M) == set(t3.M)

    t4 = HyperLogLog(range(10), b=4)
    try:
        t1.union(t4)
        raise Exception("Should have complained about parameters")
    except:
        pass