<s> from changes . testutils import TestCase <EOL> from changes . utils . text import chunked <EOL> class ChunkedTest ( TestCase ) : <EOL> def test_simple ( self ) : <EOL> foo = '<STR_LIT>' <EOL> result = list ( chunked ( foo , <NUM_LIT:5> ) ) <EOL> assert len ( result ) == <NUM_LIT:3> <EOL> assert result [ <NUM_LIT:0> ] == '<STR_LIT>' <EOL> assert result [ <NUM_LIT:1> ] == '<STR_LIT>' <EOL> assert result [ <NUM_LIT:2> ] == '<STR_LIT>' <EOL> result = list ( chunked ( foo , <NUM_LIT:8> ) ) <EOL> assert len ( result ) == <NUM_LIT:2> <EOL> assert result [ <NUM_LIT:0> ] == '<STR_LIT>' <EOL> assert result [ <NUM_LIT:1> ] == '<STR_LIT>' <EOL> result = list ( chunked ( foo , <NUM_LIT:4> ) ) <EOL> assert len ( result ) == <NUM_LIT:3> <EOL> assert result [ <NUM_LIT:0> ] == '<STR_LIT>' <EOL> assert result [ <NUM_LIT:1> ] == '<STR_LIT>' <EOL> assert result [ <NUM_LIT:2> ] == '<STR_LIT>' <EOL> foo = '<STR_LIT:a>' * <NUM_LIT:10> <EOL> result = list ( chunked ( foo , <NUM_LIT:2> ) ) <EOL> assert len ( result ) == <NUM_LIT:5> <EOL> assert all ( r == '<STR_LIT>' for r in result ) <EOL> foo = '<STR_LIT>' <EOL> result = list ( chunked ( foo , <NUM_LIT:3> ) ) <EOL> assert len ( result ) == <NUM_LIT:4> </s>
