예제 #1
0
def test_addSeq():
    bset = BabyIntegerSet([1, 3, 5, 3])
    bset.addSeq([1, 3, 5, 7])
    assert len(bset.dump_data()) == 4
예제 #2
0
def test_init():
    bset = BabyIntegerSet()
    assert len(bset.dump_data()) == 0
예제 #3
0
def test_init_empty():
    bset = BabyIntegerSet([1, 3, 5, 3])
    assert len(bset.dump_data()) == 3
예제 #4
0
def test_remove_all_odds():
    bset = BabyIntegerSet([1, 3, 5, 3])
    bset.remove_all_odds()
    assert len(bset.dump_data()) == 0
예제 #5
0
def test_sortme():
    bset = BabyIntegerSet([5, 7, 1, 3])
    bset.sortme()
    assert (bset.dump_data()) == [1, 3, 5, 7]
예제 #6
0
def test_size():
    bset = BabyIntegerSet([1, 3, 5, 2])
    bset.size()
    assert len(bset.dump_data()) == 4
예제 #7
0
def test_clear():
    bset = BabyIntegerSet([1, 4, 7])
    bset.clear()
    assert len(bset.dump_data()) == 0