ccff85dc6ec7d2eb374bae7b4f799bb3b72d68aa
[hooke.git] / test / note.py
1 # Copyright (C) 2010 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 Success
26 <BLANKLINE>
27 >>> h = r.run_lines(h, ['glob_curves_to_playlist test/data/vclamp_picoforce/*']
28 ...     )  # doctest: +ELLIPSIS
29 <Curve 0x06130001>
30 <Curve 0x07200000>
31 <Curve 20071120a_i27_t33.100>
32 <Curve 20071120a_i27_t33.101>
33 ...
34 <Curve 20071120a_i27_t33.199>
35 Success
36 <BLANKLINE>
37 >>> h = r.run_lines(h, ['jump_to_curve 14'])
38 Success
39 <BLANKLINE>
40 >>> h = r.run_lines(h, ['''set_note "Hi there.\\nI'm a note"'''])
41 Success
42 <BLANKLINE>
43 >>> h = r.run_lines(h, ['jump_to_curve 27'])
44 Success
45 <BLANKLINE>
46 >>> h = r.run_lines(h, ['''set_note "I'm another note."'''])
47 Success
48 <BLANKLINE>
49 >>> h = r.run_lines(h, ['note_filter_playlist --output_playlist filtered'])
50 <FilePlaylist filtered>
51 Success
52 <BLANKLINE>
53 >>> h = r.run_lines(h, ['get_playlist'])
54 <FilePlaylist mylist>
55 Success
56 <BLANKLINE>
57 >>> h = r.run_lines(h, ['jump_to_playlist -- -1'])
58 Success
59 <BLANKLINE>
60 >>> h = r.run_lines(h, ['get_playlist'])
61 <FilePlaylist filtered>
62 Success
63 <BLANKLINE>
64 >>> h = r.run_lines(h, ['get_curve'])
65 <Curve 20071120a_i27_t33.112>
66 Success
67 <BLANKLINE>
68 >>> h = r.run_lines(h, ['curve_index'])
69 0
70 Success
71 <BLANKLINE>
72 >>> h = r.run_lines(h, ['jump_to_curve -- -1'])
73 Success
74 <BLANKLINE>
75 >>> h = r.run_lines(h, ['get_curve'])
76 <Curve 20071120a_i27_t33.125>
77 Success
78 <BLANKLINE>
79 >>> h = r.run_lines(h, ['curve_index'])
80 1
81 Success
82 <BLANKLINE>
83 >>> h = r.run_lines(h, ['get_note'])
84 I'm another note.
85 Success
86 <BLANKLINE>
87 >>> h = r.run_lines(h, ['set_note ""'])
88 Success
89 <BLANKLINE>
90 >>> h = r.run_lines(h, ['get_note'])
91 None
92 Success
93 <BLANKLINE>
94 """