Moved interesting old vclamp commands over into the curve plugin
[hooke.git] / test / unicode_output.py
1 # -*- coding: utf-8 -*-
2 #
3 # Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
4 #
5 # This file is part of Hooke.
6 #
7 # Hooke is free software: you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as
9 # published by the Free Software Foundation, either version 3 of the
10 # License, or (at your option) any later version.
11 #
12 # Hooke is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
15 # Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with Hooke.  If not, see
19 # <http://www.gnu.org/licenses/>.
20
21 u"""
22 >>> from hooke.hooke import Hooke, HookeRunner
23 >>> h = Hooke()
24 >>> r = HookeRunner()
25 >>> h = r.run_lines(h, ['help flat_filter_playlist']) # doctest: +REPORT_UDIFF +ELLIPSIS
26 Command: flat_filter_playlist...
27       F. Musiani, M. Brucale, L. Bubacco, B. Samorì.
28       "Conformational equilibria in monomeric α-Synuclein at the
29 ...
30 """
31
32 import sys
33 reload(sys)
34 sys.setdefaultencoding('utf-8')
35 import hooke.util.encoding
36 hooke.util.encoding.get_encoding = lambda : 'utf-8'
37
38 # Override defaultencoding and get_encoding to work around
39 # doctest/unicode limitations:
40 #   Doctest: test.unicode_output
41 #   ... /usr/lib/python2.6/doctest.py:1475: UnicodeWarning: Unicode
42 #   equal comparison failed to convert both arguments to Unicode -
43 #   interpreting them as being unequal
44 #
45 # see
46 #   http://stackoverflow.com/questions/1733414/how-do-i-include-unicode-strings-in-python-doctests
47 # for details.
48 #
49 # Unfortunately, the override also makes the codecs.getwriter() code
50 # that this test is supposed to check a no-op.  Ah well, guess this
51 # will have to wait for Python 3.