Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 34134:d4d4d11bac77
doctest: replace str() with bytes()
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 03 Sep 2017 14:38:58 +0900 |
parents | 0fa781320203 |
children | a8994d08e4a2 |
comparison
equal
deleted
inserted
replaced
34133:708b5530a273 | 34134:d4d4d11bac77 |
---|---|
2810 def __bytes__(self): | 2810 def __bytes__(self): |
2811 r"""Join the URL's components back into a URL string. | 2811 r"""Join the URL's components back into a URL string. |
2812 | 2812 |
2813 Examples: | 2813 Examples: |
2814 | 2814 |
2815 >>> str(url(b'http://user:pw@host:80/c:/bob?fo:oo#ba:ar')) | 2815 >>> bytes(url(b'http://user:pw@host:80/c:/bob?fo:oo#ba:ar')) |
2816 'http://user:pw@host:80/c:/bob?fo:oo#ba:ar' | 2816 'http://user:pw@host:80/c:/bob?fo:oo#ba:ar' |
2817 >>> str(url(b'http://user:pw@host:80/?foo=bar&baz=42')) | 2817 >>> bytes(url(b'http://user:pw@host:80/?foo=bar&baz=42')) |
2818 'http://user:pw@host:80/?foo=bar&baz=42' | 2818 'http://user:pw@host:80/?foo=bar&baz=42' |
2819 >>> str(url(b'http://user:pw@host:80/?foo=bar%3dbaz')) | 2819 >>> bytes(url(b'http://user:pw@host:80/?foo=bar%3dbaz')) |
2820 'http://user:pw@host:80/?foo=bar%3dbaz' | 2820 'http://user:pw@host:80/?foo=bar%3dbaz' |
2821 >>> str(url(b'ssh://user:pw@[::1]:2200//home/joe#')) | 2821 >>> bytes(url(b'ssh://user:pw@[::1]:2200//home/joe#')) |
2822 'ssh://user:pw@[::1]:2200//home/joe#' | 2822 'ssh://user:pw@[::1]:2200//home/joe#' |
2823 >>> str(url(b'http://localhost:80//')) | 2823 >>> bytes(url(b'http://localhost:80//')) |
2824 'http://localhost:80//' | 2824 'http://localhost:80//' |
2825 >>> str(url(b'http://localhost:80/')) | 2825 >>> bytes(url(b'http://localhost:80/')) |
2826 'http://localhost:80/' | 2826 'http://localhost:80/' |
2827 >>> str(url(b'http://localhost:80')) | 2827 >>> bytes(url(b'http://localhost:80')) |
2828 'http://localhost:80/' | 2828 'http://localhost:80/' |
2829 >>> str(url(b'bundle:foo')) | 2829 >>> bytes(url(b'bundle:foo')) |
2830 'bundle:foo' | 2830 'bundle:foo' |
2831 >>> str(url(b'bundle://../foo')) | 2831 >>> bytes(url(b'bundle://../foo')) |
2832 'bundle:../foo' | 2832 'bundle:../foo' |
2833 >>> str(url(b'path')) | 2833 >>> bytes(url(b'path')) |
2834 'path' | 2834 'path' |
2835 >>> str(url(b'file:///tmp/foo/bar')) | 2835 >>> bytes(url(b'file:///tmp/foo/bar')) |
2836 'file:///tmp/foo/bar' | 2836 'file:///tmp/foo/bar' |
2837 >>> str(url(b'file:///c:/tmp/foo/bar')) | 2837 >>> bytes(url(b'file:///c:/tmp/foo/bar')) |
2838 'file:///c:/tmp/foo/bar' | 2838 'file:///c:/tmp/foo/bar' |
2839 >>> print url(br'bundle:foo\bar') | 2839 >>> print url(br'bundle:foo\bar') |
2840 bundle:foo\bar | 2840 bundle:foo\bar |
2841 >>> print url(br'file:///D:\data\hg') | 2841 >>> print url(br'file:///D:\data\hg') |
2842 file:///D:\data\hg | 2842 file:///D:\data\hg |