test:tutorial: add 0x05120005 to doctest
[hooke.git] / test / tutorial.py
index 7c115d6eefdd7518b63deb4e46b2298c32380711..aa51244e3036cd9d8fbff805aeede11510883458 100644 (file)
@@ -1,20 +1,19 @@
-# Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@tremily.us>
 #
 # This file is part of Hooke.
 #
-# Hooke is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
+# Hooke is free software: you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
 #
-# Hooke is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
-# Public License for more details.
+# Hooke is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
+# details.
 #
-# You should have received a copy of the GNU Lesser General Public
-# License along with Hooke.  If not, see
-# <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public License
+# along with Hooke.  If not, see <http://www.gnu.org/licenses/>.
 
 """
 Test the commands listed in :file:`doc/tutorial.txt`.
@@ -33,16 +32,15 @@ Documented commands (type help <topic>):
 ========================================
 ...
 >>> h = r.run_lines(h, ['help load_playlist'])
-Command: load_playlist
+Usage: load_playlist [options]
 <BLANKLINE>
-Arguments:
-<BLANKLINE>
-help BOOL (bool) Print a help message.
-stack BOOL (bool) Add this command to appropriate command stacks.
-output_playlist STRING (string) Name of the new playlist (defaults to
-    an auto-generated name).
-input FILE (file) File name for the input playlist.
-drivers DRIVER (driver) Drivers for loading curves.
+Options:
+  -h, --help            show this help message and exit
+  --disable-stack       Add this command to appropriate command stacks. (True)
+  --output_playlist=OUTPUT_PLAYLIST
+                        Name of the new playlist (defaults to an auto-
+                        generated name). (None)
+  --drivers=DRIVERS     Drivers for loading curves. (None)
 <BLANKLINE>
 Load a playlist.
 <BLANKLINE>
@@ -81,7 +79,8 @@ Success
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['glob_curves_to_playlist test/data/vclamp_picoforce/*']
-...     )  # doctest: +ELLIPSIS
+...     )  # doctest: +ELLIPSIS, +REPORT_UDIFF
+<Curve 0x05120005>
 <Curve 0x06130001>
 <Curve 0x07200000>
 <Curve 20071120a_i27_t33.100>
@@ -96,10 +95,14 @@ False
 >>> h = r.run_lines(h, ['save_playlist --output mylist'])
 Success
 <BLANKLINE>
+>>> h = r.run_lines(h, ['name_playlist my_old_list'])
+<FilePlaylist my_old_list>
+Success
+<BLANKLINE>
 >>> os.path.isfile('mylist.hkp')
 True
 >>> h = r.run_lines(h, ['load_playlist mylist.hkp'])
-<FilePlaylist mylist.hkp>
+<FilePlaylist mylist>
 Success
 <BLANKLINE>
 >>> if playlist_already_exists == False:
@@ -108,21 +111,21 @@ Success
 *Navigating the playlist*
 
 >>> h = r.run_lines(h, ['get_curve'])
-<Curve 0x06130001>
+<Curve 0x05120005>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['next_curve'])
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_curve'])
-<Curve 0x07200000>
+<Curve 0x06130001>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['previous_curve'])
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_curve'])
-<Curve 0x06130001>
+<Curve 0x05120005>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['curve_index'])
@@ -137,14 +140,14 @@ Success
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['curve_index'])
-101
+102
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['next_curve'])
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_curve'])
-<Curve 0x06130001>
+<Curve 0x05120005>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['curve_index'])
@@ -155,7 +158,7 @@ Success
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_curve'])
-<Curve 20071120a_i27_t33.112>
+<Curve 20071120a_i27_t33.111>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['curve_index'])
@@ -163,22 +166,24 @@ Success
 Success
 <BLANKLINE>
 
+>>> [p for p in h.playlists]
+[<FilePlaylist my_old_list>, <FilePlaylist mylist>]
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist mylist>
+<FilePlaylist my_old_list>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['next_playlist'])
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist mylist.hkp>
+<FilePlaylist mylist>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['previous_playlist'])
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist mylist>
+<FilePlaylist my_old_list>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['playlist_index'])
@@ -189,7 +194,7 @@ Success
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist mylist.hkp>
+<FilePlaylist mylist>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['playlist_index'])
@@ -200,7 +205,7 @@ Success
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist mylist>
+<FilePlaylist my_old_list>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['playlist_index'])
@@ -211,7 +216,7 @@ Success
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['get_playlist'])
-<FilePlaylist mylist.hkp>
+<FilePlaylist mylist>
 Success
 <BLANKLINE>
 >>> h = r.run_lines(h, ['playlist_index'])
@@ -243,8 +248,6 @@ See :file:`command_stack.py`,
 
 See :file:`multiple_curve_analysis`.
 
-*Fast curve reviewing and saving*
-
 *Configuring Hooke*
 
 See :file:`config.py`.