def test_empty( self ):

        empty = DateRangeIndex( 'empty' )

        assert empty.getEntryForObject( 1234 ) is None
        empty.unindex_object( 1234 ) # shouldn't throw

        assert not empty.uniqueValues( 'foo' )
        assert not empty.uniqueValues( 'foo', 1 )

        assert empty._apply_index( { 'zed' : 12345 } ) is None

        result, used = empty._apply_index( { 'empty' : 12345 } )

        assert not result
        assert used == ( None, None )
    def test_retrieval( self ):

        work = DateRangeIndex( 'work', 'start', 'stop' )

        for i in range( len( dummies ) ):
            work.index_object( i, dummies[i] )

        for i in range( len( dummies ) ):
            assert work.getEntryForObject( i ) == dummies[i].datum()

        for value in range( -1, 15 ):

            matches = matchingDummies( value )
            results, used = work._apply_index( { 'work' : value } )
            assert used == ( 'start', 'stop' )

            assert len( matches ) == len( results ), ( '%s: %s == %s'
               % ( value, map( lambda x: x.name(), matches ), results ) )

            matches.sort( lambda x, y: cmp( x.name(), y.name() ) )

            for result, match in map( None, results, matches ):
                assert work.getEntryForObject( result ) == match.datum()