view tests/doctest.txt @ 3:00266c7a7c3c

since there is only one module, dont bother with the whole directory thing
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 17 Jun 2011 10:39:37 -0700
parents 20dde2687cfb
children 6b99523536ee
line wrap: on
line source

Test urlmatch
=============

The obligatory imports::

    >>> from urlmatcher import UrlMatcher

Test matching::

    >>> matcher = UrlMatcher('http://www.example.com/foo/bar/fleem')
    >>> matcher.add('http://www.example.com/foo/blah')
    >>> matcher.add('https://www.example.com/foo/')
    >>> matcher.add('https://www.example.net/foo/')
    >>> sorted(matcher.match('example.com/foo/bar'))
    ['http://www.example.com/foo/bar/fleem', ]
    >>> sorted(matcher.match('http://example.com/foo'))
    >>> sorted(matcher.match('example.com'))
    >>> sorted(matcher.match('example'))


Test url diffs::

    >>> matcher = urlmatcher()