testing.unit.test_lazy module

class testing.unit.test_lazy.AndOrTestCase(*args)[source]

Bases: Iterators

Test And and Or

testAndShortcut()[source]

And should return if any false

testEmpty()[source]

And() -> true, Or() -> false

testNormalAnd()[source]

And should go through true iterators, picking last

testNormalOr()[source]

Or goes through false iterators, picking last

testOrShortcut()[source]

Or should return if any true

class testing.unit.test_lazy.CatTestCase(*args)[source]

Bases: Iterators

Test concatenation of iterators

testEmpty()[source]

Empty + empty = empty

testNumbers()[source]

1 to 50 + 51 to 100 = 1 to 100

testShortcut()[source]

Process iterators in order

class testing.unit.test_lazy.FilterTestCase(*args)[source]

Bases: Iterators

Tests for lazy_filter function

testEmpty()[source]

empty iterators -> empty iterators

testError()[source]

Should raise appropriate error

testNum1()[source]

Test numbers 1 - 100 #1

class testing.unit.test_lazy.FoldingTest(*args)[source]

Bases: Iterators

Test folding operations

f(x, y)[source]
testAddition()[source]

Use folds to sum lists

testEmpty()[source]

Folds of empty iterators should produce defaults

testLargeAddition()[source]

Folds on 10000 element iterators

testLen()[source]

Use folds to calculate length of lists

class testing.unit.test_lazy.ITRBadder[source]

Bases: ITRBranch

branch_process(subinstance)[source]

Process a branch right after it is finished (stub)

end_process()[source]

Do any final processing before leaving branch (stub)

start_process(index)[source]

Do some initial processing (stub)

class testing.unit.test_lazy.ITRBadder2[source]

Bases: ITRBranch

branch_process(subinstance)[source]

Process a branch right after it is finished (stub)

can_fast_process(index)[source]

True if object can be processed without new branch (stub)

end_process()[source]

Do any final processing before leaving branch (stub)

fast_process(index)[source]

Process args without new child branch (stub)

start_process(index)[source]

Do some initial processing (stub)

class testing.unit.test_lazy.IterEqualTestCase(*args)[source]

Bases: Iterators

Tests for iter_equal function

testEmpty()[source]

Empty iterators should be equal

testGenerators()[source]

equals works for generators

testLength()[source]

Differently sized iterators

testNormal()[source]

See if normal iterators are equal

testNormalInequality()[source]

See if normal unequals work

class testing.unit.test_lazy.Iterators(*args)[source]

Bases: UnitTestCase

__init__(*args)[source]

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

alwayserror(x)[source]
empty()
emptygen_maker()[source]
evens()
falseerror_maker()[source]
nameerror_maker()[source]
odds()
one_to_100()
trueerror_maker()[source]
typeerror_maker()[source]
class testing.unit.test_lazy.MapTestCase(*args)[source]

Bases: Iterators

Test mapping of iterators

testEmpty()[source]

Map of an empty iterator is empty

testNumbers()[source]

1 to 100 * 2 = 2 to 200

testShortcut()[source]

Map should go in order

class testing.unit.test_lazy.MultiplexTest(*args)[source]

Bases: Iterators

testDouble()[source]

Test splitting into two…

testSingle()[source]

Test multiplex single stream

testTrible()[source]

Test splitting iterator into three

class testing.unit.test_lazy.TreeReducerTest(methodName='runTest')[source]

Bases: UnitTestCase

setUp()[source]

Hook method for setting up the test fixture before exercising it.

testTreeReducer()[source]

testing IterTreeReducer

testTreeReducerState()[source]

Test saving and recreation of an IterTreeReducer