Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(6)  |  Derive(0)  |  Import(1)

src/x/o/xodb-HEAD/tests/test_xapian.py   xodb(Download)
import tempfile
import xapian
from xodb import MultipleValueRangeProcessor
from xodb.exc import PrefixError
 
def test_value_range_processor():
    vp = MultipleValueRangeProcessor(dict(foo=1, bar=2), str.upper)
    assert vp('foo:abc', 'def') == (1, 'ABC', 'DEF')
    assert vp('bar:news', 'def') == (2, 'NEWS', 'DEF')
    assert vp('bar:', 'def') == (2, '', 'DEF')