Add wtk driver for W. Trevor King's velocity clamp data format.
[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
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation, either
10 # version 3 of the License, or (at your option) any later version.
11 #
12 # Hooke is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU Lesser General 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
36 # setdefaultencoding to work around doctest/unicode limitations:
37 #   Doctest: test.unicode_output
38 #   ... /usr/lib/python2.6/doctest.py:1475: UnicodeWarning: Unicode
39 #   equal comparison failed to convert both arguments to Unicode -
40 #   interpreting them as being unequal
41 #
42 # see
43 #   http://stackoverflow.com/questions/1733414/how-do-i-include-unicode-strings-in-python-doctests
44 # for details.
45 #
46 # Unfortunately, the setdefaultencoding also makes the
47 # codecs.getwriter() code that this test is supposed to check a no-op.
48 # Ah well, guess this will have to wait for Python 3.