#NEWLINE# def test_intersect_1( ) : #NEWLINE# #INDENT# ' Convert 1 D chunks' #NEWLINE# old = ( ( 10 , 10 , 10 , 10 , 10 ) , ) #NEWLINE# new = ( ( 25 , 5 , 20 ) , ) #NEWLINE# answer = ( ( ( ( 0 , slice ( 0 , 10 , None ) ) , ) , ( ( 1 , slice ( 0 , 10 , None ) ) , ) , ( ( 2 , slice ( 0 , 5 , None ) ) , ) ) , ( ( ( 2 , slice ( 5 , 10 , None ) ) , ) , ) , ( ( ( 3 , slice ( 0 , 10 , None ) ) , ) , ( ( 4 , slice ( 0 , 10 , None ) ) , ) ) ) #NEWLINE# cross = intersect_chunks ( old_chunks = old , new_chunks = new ) #NEWLINE# assert ( answer == cross )