import nose
from books import reconstruct_stack
from stack import Stack

def test_reconstruct():
    original = Stack()
    original.push('a')
    original.push('b')
    original.push('c')
    original.push('d')
    original.push('e')
    original.push('f')
    
    # m1,m2,and m3 are the mini-piles after the stack is toppled
    
    m1 = Stack()
    m1.push('a')
    m1.push('b')
    m1.push('c')
    
    m2 = Stack()
    m2.push('d')
    
    m3 = Stack()
    m3.push('e')
    m3.push('f')
        
    r1 = reconstruct_stack(original,[m2,m3,m1])
    
    assert r1 == ['c','d','f']

if __name__ == "__main__":
    nose.runmodule()