Mercurial > hg > urlmatch
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 1:750dc780d3d8 | 2:20dde2687cfb |
|---|---|
| 1 Test urlmatch | |
| 2 ============= | |
| 3 | |
| 4 The obligatory imports:: | |
| 5 | |
| 6 >>> from urlmatcher import UrlMatcher | |
| 7 | |
| 8 Test matching:: | |
| 9 | |
| 10 >>> matcher = UrlMatcher('http://www.example.com/foo/bar/fleem') | |
| 11 >>> matcher.add('http://www.example.com/foo/blah') | |
| 12 >>> matcher.add('https://www.example.com/foo/') | |
| 13 >>> matcher.add('https://www.example.net/foo/') | |
| 14 >>> sorted(matcher.match('example.com/foo/bar')) | |
| 15 ['http://www.example.com/foo/bar/fleem', ] | |
| 16 >>> sorted(matcher.match('http://example.com/foo')) | |
| 17 >>> sorted(matcher.match('example.com')) | |
| 18 >>> sorted(matcher.match('example')) | |
| 19 | |
| 20 | |
| 21 Test url diffs:: | |
| 22 | |
| 23 >>> matcher = urlmatcher() |
