8fae0952d497dc0a9e246792f960bb346b8a5aaf
[hooke.git] / test / note.py
1 # Copyright (C) 2010-2012 W. Trevor King <wking@drexel.edu>
2 #
3 # This file is part of Hooke.
4 #
5 # Hooke is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as
7 # published by the Free Software Foundation, either version 3 of the
8 # License, or (at your option) any later version.
9 #
10 # Hooke is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
13 # Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with Hooke.  If not, see
17 # <http://www.gnu.org/licenses/>.
18
19 """
20 >>> from hooke.hooke import Hooke, HookeRunner
21 >>> h = Hooke()
22 >>> r = HookeRunner()
23
24 >>> h = r.run_lines(h, ['new_playlist --output_playlist mylist'])
25 <FilePlaylist mylist>
26 Success
27 <BLANKLINE>
28 >>> h = r.run_lines(h, ['glob_curves_to_playlist test/data/vclamp_picoforce/*']
29 ...     )  # doctest: +ELLIPSIS
30 <Curve 0x06130001>
31 <Curve 0x07200000>
32 <Curve 20071120a_i27_t33.100>
33 <Curve 20071120a_i27_t33.101>
34 ...
35 <Curve 20071120a_i27_t33.199>
36 Success
37 <BLANKLINE>
38 >>> h = r.run_lines(h, ['jump_to_curve 14'])
39 Success
40 <BLANKLINE>
41 >>> h = r.run_lines(h, ['''set_note "Hi there.\\nI'm a note"'''])
42 Success
43 <BLANKLINE>
44 >>> h = r.run_lines(h, ['jump_to_curve 27'])
45 Success
46 <BLANKLINE>
47 >>> h = r.run_lines(h, ['''set_note "I'm another note."'''])
48 Success
49 <BLANKLINE>
50 >>> h = r.run_lines(h, ['note_filter_playlist --output_playlist filtered'])
51 <FilePlaylist filtered>
52 Success
53 <BLANKLINE>
54 >>> h = r.run_lines(h, ['get_playlist'])
55 <FilePlaylist mylist>
56 Success
57 <BLANKLINE>
58 >>> h = r.run_lines(h, ['jump_to_playlist -- -1'])
59 Success
60 <BLANKLINE>
61 >>> h = r.run_lines(h, ['get_playlist'])
62 <FilePlaylist filtered>
63 Success
64 <BLANKLINE>
65 >>> h = r.run_lines(h, ['get_curve'])
66 <Curve 20071120a_i27_t33.112>
67 Success
68 <BLANKLINE>
69 >>> h = r.run_lines(h, ['curve_index'])
70 0
71 Success
72 <BLANKLINE>
73 >>> h = r.run_lines(h, ['jump_to_curve -- -1'])
74 Success
75 <BLANKLINE>
76 >>> h = r.run_lines(h, ['get_curve'])
77 <Curve 20071120a_i27_t33.125>
78 Success
79 <BLANKLINE>
80 >>> h = r.run_lines(h, ['curve_index'])
81 1
82 Success
83 <BLANKLINE>
84 >>> h = r.run_lines(h, ['get_note'])
85 I'm another note.
86 Success
87 <BLANKLINE>
88 >>> h = r.run_lines(h, ['set_note ""'])
89 Success
90 <BLANKLINE>
91 >>> h = r.run_lines(h, ['get_note'])
92 None
93 Success
94 <BLANKLINE>
95 """