Ejemplo n.º 1
0
def test_addition_operator_mem_check():
    test_str  = MyList("abc")
    test_str2 = MyList("def")
    test_str3 = test_str + test_str2
    test_str2.pop_back()

    assert get_MyList(test_str3) == "abcdef"
Ejemplo n.º 2
0
def test_addition_operator_mem_check():
    test_str = MyList("abc")
    test_str2 = MyList("def")
    test_str3 = test_str + test_str2
    test_str2.pop_back()

    assert get_MyList(test_str3) == "abcdef"
Ejemplo n.º 3
0
def test_pop_back_nonempty():
    test_popb = MyList("popping")
    for _ in xrange(4):
        test_popb.pop_back()
    assert get_MyList(test_popb) == "pop"
Ejemplo n.º 4
0
def test_pop_back_empty():
    test_popb = MyList()
    test_popb.pop_back()
    assert get_MyList(test_popb) == ""
Ejemplo n.º 5
0
def test_equals_operator_nonempty_mem_check():
    test_string = MyList("test")
    test_str2   = MyList("newstring")
    test_string.reassign(test_str2)
    test_str2.pop_back()
    assert get_MyList(test_string) != get_MyList(test_str2)
Ejemplo n.º 6
0
def test_pop_back_nonempty():
    test_popb = MyList("popping")
    for _ in xrange(4):
        test_popb.pop_back()
    assert get_MyList(test_popb) == "pop"
Ejemplo n.º 7
0
def test_pop_back_empty():
    test_popb = MyList()
    test_popb.pop_back()
    assert get_MyList(test_popb) == ""
Ejemplo n.º 8
0
def test_equals_operator_nonempty_mem_check():
    test_string = MyList("test")
    test_str2 = MyList("newstring")
    test_string.reassign(test_str2)
    test_str2.pop_back()
    assert get_MyList(test_string) != get_MyList(test_str2)