comparison tests/doctest.txt @ 6:0cd69fa6751c

add test for decomposition; stub diff, will have to move to 2-tuples to do this properly
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 27 Jun 2011 07:16:46 -0700
parents 6b99523536ee
children b02420253bfd
comparison
equal deleted inserted replaced
5:6b99523536ee 6:0cd69fa6751c
18 >>> sorted(matcher.match('example.com')) 18 >>> sorted(matcher.match('example.com'))
19 ['http://www.example.com/foo/bar/fleem', 'http://www.example.com/foo/blah', 'https://www.example.com/foo/'] 19 ['http://www.example.com/foo/bar/fleem', 'http://www.example.com/foo/blah', 'https://www.example.com/foo/']
20 >>> sorted(matcher.match('example')) # -> example.* 20 >>> sorted(matcher.match('example')) # -> example.*
21 ['http://www.example.com/foo/bar/fleem', 'http://www.example.com/foo/blah', 'https://www.example.com/foo/', 'https://www.example.net/foo/'] 21 ['http://www.example.com/foo/bar/fleem', 'http://www.example.com/foo/blah', 'https://www.example.com/foo/', 'https://www.example.net/foo/']
22 22
23 Test decomposition::
24
25 >>> matcher = UrlMatcher()
26 >>> sorted(matcher.decompose('http://www.example.com/foo').items())
27 [('domain', ['example', 'com', 'www']), ('path', ['foo']), ('scheme', 'http')]
28
23 Test url diffs:: 29 Test url diffs::
24 30
25 >>> matcher = UrlMatcher() 31 >>> matcher = UrlMatcher()