annotate tests/doctest.txt @ 2:20dde2687cfb

stub doctests
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 16 Jun 2011 17:59:29 -0700
parents
children 6b99523536ee
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 Test urlmatch
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 =============
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 The obligatory imports::
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 >>> from urlmatcher import UrlMatcher
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 Test matching::
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 >>> matcher = UrlMatcher('http://www.example.com/foo/bar/fleem')
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 >>> matcher.add('http://www.example.com/foo/blah')
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 >>> matcher.add('https://www.example.com/foo/')
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 >>> matcher.add('https://www.example.net/foo/')
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14 >>> sorted(matcher.match('example.com/foo/bar'))
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 ['http://www.example.com/foo/bar/fleem', ]
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16 >>> sorted(matcher.match('http://example.com/foo'))
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 >>> sorted(matcher.match('example.com'))
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 >>> sorted(matcher.match('example'))
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21 Test url diffs::
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22
20dde2687cfb stub doctests
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 >>> matcher = urlmatcher()